Skip to content

Commit 169a57e

Browse files
committed
Remove two useless comparisons
according to the updated type_limits lint.
1 parent 0e8e0b2 commit 169a57e

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/libsyntax/ext/format.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ impl<'a, 'b> Context<'a, 'b> {
268268
fn verify_arg_type(&mut self, arg: Position, ty: ArgumentType) {
269269
match arg {
270270
Exact(arg) => {
271-
if arg < 0 || self.args.len() <= arg {
271+
if self.args.len() <= arg {
272272
let msg = format!("invalid reference to argument `{}` (there \
273273
are {} arguments)", arg, self.args.len());
274274
self.ecx.span_err(self.fmtsp, msg);

src/libterm/terminfo/parser/compiled.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,7 @@ pub fn parse(file: &mut io::Reader,
220220
if bools_bytes != 0 {
221221
for i in range(0, bools_bytes) {
222222
let b = try!(file.read_byte());
223-
if b < 0 {
224-
return Err("error: expected more bools but hit EOF".to_owned());
225-
} else if b == 1 {
223+
if b == 1 {
226224
bools_map.insert(bnames[i as uint].to_owned(), true);
227225
}
228226
}

0 commit comments

Comments
 (0)