diff --git a/Cargo.toml b/Cargo.toml index 9655298..9b5feab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,6 @@ cast_possible_truncation = "allow" cloned_instead_of_copied = "allow" default_trait_access = "allow" explicit_into_iter_loop = "allow" -explicit_iter_loop = "allow" missing_errors_doc = "allow" missing_panics_doc = "allow" module_name_repetitions = "allow" diff --git a/bin/src/config.rs b/bin/src/config.rs index 7b70993..1a95eaf 100644 --- a/bin/src/config.rs +++ b/bin/src/config.rs @@ -369,7 +369,7 @@ fn parse_warning_code(src: &str) -> Result { fn vfs(files: &[PathBuf]) -> vfs::ReadOnlyVfs { let mut vfs = ReadOnlyVfs::default(); - for file in files.iter() { + for file in files { if let Ok(data) = fs::read_to_string(file) { let _id = vfs.alloc_file_id(file); vfs.set_file_contents(file, data.as_bytes()); diff --git a/bin/src/traits.rs b/bin/src/traits.rs index c080291..284adf4 100644 --- a/bin/src/traits.rs +++ b/bin/src/traits.rs @@ -51,7 +51,7 @@ fn write_stderr( let path = vfs.file_path(file_id); let range = |at: TextRange| at.start().into()..at.end().into(); let src_id = path.to_str().unwrap_or(""); - for report in lint_result.reports.iter() { + for report in &lint_result.reports { let offset = report .diagnostics .iter() @@ -99,8 +99,8 @@ fn write_errfmt( let file_id = lint_result.file_id; let src = str::from_utf8(vfs.get(file_id)).unwrap(); let path = vfs.file_path(file_id); - for report in lint_result.reports.iter() { - for diagnostic in report.diagnostics.iter() { + for report in &lint_result.reports { + for diagnostic in &report.diagnostics { let line = line(diagnostic.at.start(), src); let col = column(diagnostic.at.start(), src); writeln!( diff --git a/bin/src/utils.rs b/bin/src/utils.rs index 338098f..d453813 100644 --- a/bin/src/utils.rs +++ b/bin/src/utils.rs @@ -8,7 +8,7 @@ pub fn lint_map_of( lints: &[&'static Box], ) -> HashMap>> { let mut map = HashMap::new(); - for lint in lints.iter() { + for lint in lints { let lint = *lint; let matches = lint.match_kind(); for m in matches { diff --git a/lib/src/lib.rs b/lib/src/lib.rs index 2655292..c38217c 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -99,7 +99,7 @@ impl Report { } /// Apply all diagnostics. Assumption: diagnostics do not overlap pub fn apply(&self, src: &mut String) { - for d in self.diagnostics.iter() { + for d in &self.diagnostics { d.apply(src); } }