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

clippy: Fix manual_flatten

parent 00efcff2
No related branches found
No related tags found
1 merge request!33Fix most of clippy::complexity and clippy::correctness
......@@ -21,7 +21,6 @@ rustflags = [
"-Aunused_variables",
# clippy::complexity
"-Aclippy::manual_flatten",
"-Aclippy::match_single_binding",
"-Aclippy::needless_borrowed_reference",
"-Aclippy::needless_lifetimes",
......
......@@ -538,10 +538,8 @@ impl<'a, 'def: 'a, 'tcx: 'def> FunctionTranslator<'a, 'def, 'tcx> {
)?;
// add generic args to the fn
let generics = &type_scope.generic_scope;
for t in generics.iter() {
if let Some(ref t) = t {
translated_fn.add_generic_type(t.clone());
}
for t in generics.iter().flatten() {
translated_fn.add_generic_type(t.clone());
}
let mut t = Self {
......@@ -672,10 +670,8 @@ impl<'a, 'def: 'a, 'tcx: 'def> FunctionTranslator<'a, 'def, 'tcx> {
let type_scope = TypeTranslationScope::new(proc.get_id(), params, universal_lifetime_map)?;
// add generic args to the fn
let generics = &type_scope.generic_scope;
for t in generics.iter() {
if let Some(t) = t {
translated_fn.add_generic_type(t.clone());
}
for t in generics.iter().flatten() {
translated_fn.add_generic_type(t.clone());
}
let mut t = Self {
......@@ -1201,10 +1197,8 @@ impl<'a, 'def: 'a, 'tcx: 'def> BodyTranslator<'a, 'def, 'tcx> {
// assume that all generics are layoutable
{
let scope = self.ty_translator.scope.borrow();
for g in scope.generic_scope.iter() {
if let Some(ty) = g {
self.translated_fn.assume_synty_layoutable(radium::SynType::Literal(ty.syn_type.clone()));
}
for ty in scope.generic_scope.iter().flatten() {
self.translated_fn.assume_synty_layoutable(radium::SynType::Literal(ty.syn_type.clone()));
}
}
// assume that all used literals are layoutable
......
......@@ -742,20 +742,18 @@ impl<'tcx, 'rcx> VerificationCtxt<'tcx, 'rcx> {
}
}
for file in read {
if let Ok(file) = file {
// check if the file name is okay
let filename = file.file_name();
if let Some(filename) = filename.to_str() {
if filename == "dune" {
continue;
} else if proof_files_to_generate.contains(filename) {
continue;
} else {
println!(
"Warning: Proof file {filename} does not have a matching Rust function to verify."
);
}
for file in read.flatten() {
// check if the file name is okay
let filename = file.file_name();
if let Some(filename) = filename.to_str() {
if filename == "dune" {
continue;
} else if proof_files_to_generate.contains(filename) {
continue;
} else {
println!(
"Warning: Proof file {filename} does not have a matching Rust function to verify."
);
}
}
}
......
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