about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/common.rs10
-rw-r--r--src/libsyntax/parse/lexer.rs2
-rw-r--r--src/libsyntax/parse/parser.rs2
3 files changed, 7 insertions, 7 deletions
diff --git a/src/libsyntax/parse/common.rs b/src/libsyntax/parse/common.rs
index e0b551f0e45..092238e17be 100644
--- a/src/libsyntax/parse/common.rs
+++ b/src/libsyntax/parse/common.rs
@@ -112,14 +112,14 @@ impl parser_common of parser_common for parser {
 
     // A sanity check that the word we are asking for is a known keyword
     fn require_keyword(word: ~str) {
-        if !self.keywords.contains_key(word) {
+        if !self.keywords.contains_key_ref(&word) {
             self.bug(fmt!{"unknown keyword: %s", word});
         }
     }
 
     fn token_is_word(word: ~str, ++tok: token::token) -> bool {
         alt tok {
-          token::IDENT(sid, false) => { str::eq(word, *self.get_str(sid)) }
+          token::IDENT(sid, false) => { word == *self.get_str(sid) }
           _ => { false }
         }
     }
@@ -136,7 +136,7 @@ impl parser_common of parser_common for parser {
     fn is_any_keyword(tok: token::token) -> bool {
         alt tok {
           token::IDENT(sid, false) {
-            self.keywords.contains_key(*self.get_str(sid))
+            self.keywords.contains_key_ref(self.get_str(sid))
           }
           _ { false }
         }
@@ -148,7 +148,7 @@ impl parser_common of parser_common for parser {
         let mut bump = false;
         let val = alt self.token {
           token::IDENT(sid, false) {
-            if str::eq(word, *self.get_str(sid)) {
+            if word == *self.get_str(sid) {
                 bump = true;
                 true
             } else { false }
@@ -169,7 +169,7 @@ impl parser_common of parser_common for parser {
     }
 
     fn is_restricted_keyword(word: ~str) -> bool {
-        self.restricted_keywords.contains_key(word)
+        self.restricted_keywords.contains_key_ref(&word)
     }
 
     fn check_restricted_keywords() {
diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs
index a2d7a04a6bf..9583be3461d 100644
--- a/src/libsyntax/parse/lexer.rs
+++ b/src/libsyntax/parse/lexer.rs
@@ -456,7 +456,7 @@ fn next_token_inner(rdr: string_reader) -> token::token {
             bump(rdr);
             c = rdr.curr;
         }
-        if str::eq(accum_str, ~"_") { return token::UNDERSCORE; }
+        if accum_str == ~"_" { return token::UNDERSCORE; }
         let is_mod_name = c == ':' && nextch(rdr) == ':';
 
         // FIXME: perform NFKC normalization here. (Issue #2253)
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 29fdc884604..7d5a088a04f 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -2066,7 +2066,7 @@ class parser {
 
     fn is_self_ident() -> bool {
         alt self.token {
-            token::IDENT(sid, false) if str::eq(~"self", *self.get_str(sid)) {
+            token::IDENT(sid, false) if ~"self" == *self.get_str(sid) {
                 true
             }
             _ => {