]> git.lizzy.rs Git - rust.git/commitdiff
Remove two useless comparisons
authorVirgile Andreani <virgile.andreani@anbuco.fr>
Sun, 4 May 2014 18:48:16 +0000 (20:48 +0200)
committerVirgile Andreani <virgile.andreani@anbuco.fr>
Sun, 4 May 2014 18:48:16 +0000 (20:48 +0200)
according to the updated type_limits lint.

src/libsyntax/ext/format.rs
src/libterm/terminfo/parser/compiled.rs

index df79b1054443247f67f351a9bb3c20df64afc081..0d856fb689d449e4fc6e3356c24d43205e189587 100644 (file)
@@ -268,7 +268,7 @@ fn verify_method(&mut self, pos: Position, m: &parse::Method) {
     fn verify_arg_type(&mut self, arg: Position, ty: ArgumentType) {
         match arg {
             Exact(arg) => {
-                if arg < 0 || self.args.len() <= arg {
+                if self.args.len() <= arg {
                     let msg = format!("invalid reference to argument `{}` (there \
                                     are {} arguments)", arg, self.args.len());
                     self.ecx.span_err(self.fmtsp, msg);
index 538a1513d65a710e3775fc6d663746848784ca46..db5dd2d5c1907375cc56b339837c1cbae86308db 100644 (file)
@@ -220,9 +220,7 @@ macro_rules! try( ($e:expr) => (
     if bools_bytes != 0 {
         for i in range(0, bools_bytes) {
             let b = try!(file.read_byte());
-            if b < 0 {
-                return Err("error: expected more bools but hit EOF".to_owned());
-            } else if b == 1 {
+            if b == 1 {
                 bools_map.insert(bnames[i as uint].to_owned(), true);
             }
         }