about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVirgile Andreani <virgile.andreani@anbuco.fr>2014-05-04 20:48:16 +0200
committerVirgile Andreani <virgile.andreani@anbuco.fr>2014-05-04 20:48:16 +0200
commit169a57ee8d301c44fb285cc95fc1309d96aa37ab (patch)
treef41231004cca8500906203ac98acd71a8ba7ad86
parent0e8e0b2ede175be6a4874700674b259c8c63c2cc (diff)
downloadrust-169a57ee8d301c44fb285cc95fc1309d96aa37ab.tar.gz
rust-169a57ee8d301c44fb285cc95fc1309d96aa37ab.zip
Remove two useless comparisons
according to the updated type_limits lint.
-rw-r--r--src/libsyntax/ext/format.rs2
-rw-r--r--src/libterm/terminfo/parser/compiled.rs4
2 files changed, 2 insertions, 4 deletions
diff --git a/src/libsyntax/ext/format.rs b/src/libsyntax/ext/format.rs
index df79b105444..0d856fb689d 100644
--- a/src/libsyntax/ext/format.rs
+++ b/src/libsyntax/ext/format.rs
@@ -268,7 +268,7 @@ impl<'a, 'b> Context<'a, 'b> {
     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);
diff --git a/src/libterm/terminfo/parser/compiled.rs b/src/libterm/terminfo/parser/compiled.rs
index 538a1513d65..db5dd2d5c19 100644
--- a/src/libterm/terminfo/parser/compiled.rs
+++ b/src/libterm/terminfo/parser/compiled.rs
@@ -220,9 +220,7 @@ pub fn parse(file: &mut io::Reader,
     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);
             }
         }