about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2013-09-20 02:08:47 -0400
committerDaniel Micay <danielmicay@gmail.com>2013-10-09 09:17:29 -0400
commit6a90e80b6240d8213f2b99fa470ef6ee04552d1b (patch)
treee7ae38c849741fc9345652311dfa374f36b4be9a /src/libsyntax/parse/parser.rs
parentf647ccc79c38c1f80dbdb697900b2ba97e293263 (diff)
downloadrust-6a90e80b6240d8213f2b99fa470ef6ee04552d1b.tar.gz
rust-6a90e80b6240d8213f2b99fa470ef6ee04552d1b.zip
option: rewrite the API to use composition
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 484e40a1daa..9f1a436a4d5 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -405,7 +405,7 @@ impl Parser {
         fn tokens_to_str(p:&Parser, tokens: &[token::Token]) -> ~str {
             let mut i = tokens.iter();
             // This might be a sign we need a connect method on Iterator.
-            let b = i.next().map_default(~"", |t| p.token_to_str(*t));
+            let b = i.next().map_default(~"", |t| p.token_to_str(t));
             i.fold(b, |b,a| b + "`, `" + p.token_to_str(a))
         }
         if edible.contains(self.token) {
@@ -470,7 +470,7 @@ impl Parser {
     pub fn commit_stmt(&self, s: @Stmt, edible: &[token::Token], inedible: &[token::Token]) {
         debug2!("commit_stmt {:?}", s);
         let _s = s; // unused, but future checks might want to inspect `s`.
-        if self.last_token.map_default(false, |t|is_ident_or_path(*t)) {
+        if self.last_token.as_ref().map_default(false, |t| is_ident_or_path(*t)) {
             let expected = vec::append(edible.to_owned(), inedible);
             self.check_for_erroneous_unit_struct_expecting(expected);
         }