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

@@ -142,8 +142,8 @@ impl Pressure {
///
/// This is the out-of-line slow path for `check_avail()`.
fn check_avail_aliased(&self, entry: &TopRC) -> RegClassMask {
let first = entry.first_toprc as usize;
let num = entry.num_toprcs as usize;
let first = usize::from(entry.first_toprc);
let num = usize::from(entry.num_toprcs);
let width = entry.width as u32;
let ulimit = entry.limit * width;