···5151 let path = vfs.file_path(file_id);
5252 let range = |at: TextRange| at.start().into()..at.end().into();
5353 let src_id = path.to_str().unwrap_or("<unknown>");
5454- for report in lint_result.reports.iter() {
5454+ for report in &lint_result.reports {
5555 let offset = report
5656 .diagnostics
5757 .iter()
···9999 let file_id = lint_result.file_id;
100100 let src = str::from_utf8(vfs.get(file_id)).unwrap();
101101 let path = vfs.file_path(file_id);
102102- for report in lint_result.reports.iter() {
103103- for diagnostic in report.diagnostics.iter() {
102102+ for report in &lint_result.reports {
103103+ for diagnostic in &report.diagnostics {
104104 let line = line(diagnostic.at.start(), src);
105105 let col = column(diagnostic.at.start(), src);
106106 writeln!(
···240240241241fn column(at: TextSize, src: &str) -> usize {
242242 let at = at.into();
243243- src[..at].rfind('\n').map(|c| at - c).unwrap_or(at + 1)
243243+ src[..at].rfind('\n').map_or_else(|| at + 1, |c| at - c)
244244}
245245246246// everything within backticks is colorized, backticks are removed
···255255 part.to_string()
256256 }
257257 })
258258- .collect::<Vec<_>>()
259259- .join("")
258258+ .collect::<String>()
260259}
+1-1
bin/src/utils.rs
···88 lints: &[&'static Box<dyn Lint>],
99) -> HashMap<SyntaxKind, Vec<&'static Box<dyn Lint>>> {
1010 let mut map = HashMap::new();
1111- for lint in lints.iter() {
1111+ for lint in lints {
1212 let lint = *lint;
1313 let matches = lint.match_kind();
1414 for m in matches {
···4949 if ALLOWED_PATHS.iter().any(|&p| p == lambda_path.as_str());
5050 then {
5151 let at = node.text_range();
5252- let message = format!("`{}` is deprecated, see `:doc builtins.toPath` within the REPL for more", lambda_path);
5252+ let message = format!("`{lambda_path}` is deprecated, see `:doc builtins.toPath` within the REPL for more");
5353 Some(self.report().diagnostic(at, message))
5454 } else {
5555 None
···6161 let at = node.text_range();
6262 let replacement = {
6363 let set = value.set()?;
6464- make::inherit_from_stmt(set, &[key]).node().clone()
6464+ make::inherit_from_stmt(&set, &[key]).node().clone()
6565 };
6666 let message = "This assignment is better written with `inherit`";
6767 Some(self.report().suggest(at, message, Suggestion::new(at, replacement)))
+1-1
lib/src/lints/repeated_keys.rs
···9494 let mut message = match remaining_occurrences {
9595 0 => "... and here.".to_string(),
9696 1 => "... and here (`1` occurrence omitted).".to_string(),
9797- n => format!("... and here (`{}` occurrences omitted).", n),
9797+ n => format!("... and here (`{n}` occurrences omitted)."),
9898 };
9999 message.push_str(&format!(" Try `{} = {{ {}=...; {}=...; {}=...; }}` instead.", first_component_ident.as_str(), first_subkey, second_subkey, third_subkey));
100100 message
+1-2
lib/src/lints/useless_has_attr.rs
···6969 };
7070 let replacement = make::or_default(&set, &attr_path, &default_with_parens).node().clone();
7171 let message = format!(
7272- "Consider using `{}` instead of this `if` expression",
7373- replacement
7272+ "Consider using `{replacement}` instead of this `if` expression"
7473 );
7574 Some(
7675 self.report()