Replace as casts with type-conversion functions.

https://github.com/rust-lang-nursery/rust-clippy/wiki#cast_lossless
This commit is contained in:
Dan Gohman
2017-07-13 16:37:07 -07:00
parent af74cdf364
commit 0cacba15b9
12 changed files with 42 additions and 34 deletions

View File

@@ -26,7 +26,7 @@ impl Args {
fn new(bits: u16, enable_e: bool) -> Args {
Args {
pointer_bits: bits,
pointer_bytes: bits as u32 / 8,
pointer_bytes: u32::from(bits) / 8,
pointer_type: Type::int(bits).unwrap(),
regs: 0,
reg_limit: if enable_e { 6 } else { 8 },