about summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2012-09-07 18:53:14 -0700
committerPatrick Walton <pcwalton@mimiga.net>2012-09-10 12:48:42 -0700
commit22b875770543ec1fe93cfb35fd07c692db5675e2 (patch)
tree62004747db05cf0fb7d82b85133210c67e2c7bb3 /src/libsyntax/ext
parent9a15c50f6c3cec5320ef91f000142af0367890a4 (diff)
downloadrust-22b875770543ec1fe93cfb35fd07c692db5675e2.tar.gz
rust-22b875770543ec1fe93cfb35fd07c692db5675e2.zip
rustc: Make shape-based compare glue never called for comparison operators.
Only called for string patterns.
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/pipes/proto.rs2
-rw-r--r--src/libsyntax/ext/simplext.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/ext/pipes/proto.rs b/src/libsyntax/ext/pipes/proto.rs
index 4065c8cf2ba..cb470aee7f3 100644
--- a/src/libsyntax/ext/pipes/proto.rs
+++ b/src/libsyntax/ext/pipes/proto.rs
@@ -143,7 +143,7 @@ struct protocol_ {
     fn get_state_by_id(id: uint) -> state { self.states[id] }
 
     fn has_state(name: ~str) -> bool {
-        self.states.find(|i| i.name == name) != None
+        self.states.find(|i| i.name == name).is_some()
     }
 
     fn filename() -> ~str {
diff --git a/src/libsyntax/ext/simplext.rs b/src/libsyntax/ext/simplext.rs
index bb5af8402df..c6ddc449b20 100644
--- a/src/libsyntax/ext/simplext.rs
+++ b/src/libsyntax/ext/simplext.rs
@@ -68,7 +68,7 @@ fn elts_to_ell(cx: ext_ctxt, elts: ~[@expr]) ->
         match elt.node {
           expr_mac(m) => match m.node {
             ast::mac_ellipsis => {
-                if res != None {
+                if res.is_some() {
                     cx.span_fatal(m.span, ~"only one ellipsis allowed");
                 }
                 res =
@@ -449,7 +449,7 @@ fn p_t_s_rec(cx: ext_ctxt, m: matchable, s: selector, b: binders) {
                 }
               }
               {pre: pre, rep: None, post: post} => {
-                if post != ~[] {
+                if post.len() > 0 {
                     cx.bug(~"elts_to_ell provided an invalid result");
                 }
                 p_t_s_r_length(cx, vec::len(pre), false, s, b);