Fixing clippy warnings

This commit is contained in:
Tomasz Drwięga
2016-05-17 10:32:05 +02:00
parent f7929ffdd4
commit a950b81ee8
21 changed files with 32 additions and 44 deletions

View File

@@ -33,7 +33,6 @@ use syntax::ast::{
use syntax::ast;
use syntax::codemap::Span;
use syntax::ext::base::{Annotatable, ExtCtxt};
use syntax::ext::build::AstBuilder;
use syntax::ptr::P;
pub struct Error;

View File

@@ -252,14 +252,14 @@ fn binary_expr_struct(
map_stmts.push(quote_stmt!(cx, map[$field_index] = total;).unwrap());
if ::syntax::print::pprust::ty_to_string(&codegen::strip_ptr(&field.ty)) == "u8" {
map_stmts.push(quote_stmt!(cx, total = total + 1;).unwrap());
map_stmts.push(quote_stmt!(cx, total += 1;).unwrap());
}
else {
map_stmts.push(quote_stmt!(cx, let size = match $field_type_ident_qualified::len_params() {
0 => mem::size_of::<$field_type_ident>(),
_ => length_stack.pop_front().unwrap(),
}).unwrap());
map_stmts.push(quote_stmt!(cx, total = total + size;).unwrap());
map_stmts.push(quote_stmt!(cx, total += size;).unwrap());
}
};