Skip to content
Snippets Groups Projects
Verified Commit c13062ca authored by Vincent Lafeychine's avatar Vincent Lafeychine
Browse files

clippy: Fix cast_lossless

parent fd79e184
No related branches found
No related tags found
1 merge request!44Fix most of `clippy::pedantic`
......@@ -32,7 +32,6 @@ rustflags = [
"-Aclippy::string_lit_as_bytes",
# clippy::pedantic
"-Aclippy::cast_lossless",
"-Aclippy::cloned_instead_of_copied",
"-Aclippy::default_trait_access",
"-Aclippy::doc_markdown",
......
......@@ -662,7 +662,9 @@ impl BigInt {
fn reserve_two_digits(&mut self) {
let len = self.digits.len();
let desired = len + !self.digits.ends_with(&[0, 0]) as usize + !self.digits.ends_with(&[0]) as usize;
let desired =
len + usize::from(!self.digits.ends_with(&[0, 0])) + usize::from(!self.digits.ends_with(&[0]));
self.digits.resize(desired, 0);
}
}
......
......@@ -950,7 +950,7 @@ impl<'def, 'tcx: 'def> TypeTranslator<'def, 'tcx> {
map.insert(name, evaluated_int);
},
ty::VariantDiscr::Relative(offset) => {
let idx: i128 = last_explicit_discr + (offset as i128);
let idx: i128 = last_explicit_discr + i128::from(offset);
map.insert(name, idx);
},
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment