uutils / findutils

Rust implementation of findutils
MIT License
299 stars 36 forks source link

Fix clippy warning `variables can be used directly in the 'format!' string` #223

Closed sylvestre closed 1 year ago

sylvestre commented 1 year ago

cargo +nightly clippy --allow-dirty --fix -- -W clippy::pedantic finds 34 occurrences

For example:


warning: variables can be used directly in the `format!` string
  --> src/find/matchers/delete.rs:49:17
   |
49 |                 writeln!(&mut stderr(), "Failed to delete {}: {}", path_str, e).unwrap();
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
   = note: `-W clippy::uninlined-format-args` implied by `-W clippy::pedantic`
help: change this to
   |
49 -                 writeln!(&mut stderr(), "Failed to delete {}: {}", path_str, e).unwrap();
49 +                 writeln!(&mut stderr(), "Failed to delete {path_str}: {e}").unwrap();