Files
rust/tests
Yuri Astrakhan aaa5bd244e Add useless_borrows_in_formatting lint
Detect format macros where an argument
is passed with an explicit `&` even though the formatter already takes
references, e.g. `println!("{}", &s)` when `s: &str`.

Some original micro-benchmarks showed ~6% performance improvement when redundant refs are removed.

- Lint runs for both Display (`{}`) and Debug (`{:?}`) placeholders when
  the inner type is Sized and implements the corresponding trait.
- Applies to the main value argument and to width/precision arguments
  (e.g. `format!("{0:1$.2$}", &v1, &v2, &v3)`).
- Suggests removing the redundant `&` with MachineApplicable fix.
- Skip when the argument comes from expansion or a proc macro.
2026-04-17 11:04:55 -04:00
..
2026-04-17 11:04:55 -04:00