Skip to content

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

Closed

Description

@sylvestre

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();

Activity

  1. changed the title [-]Fix clippy warning ```variables can be used directly in the `format!` string```[/-] [+]Fix clippy warning `variables can be used directly in the 'format!' string`[/+] on Apr 2, 2023
  2. added a commit that references this issue on Aug 10, 2023
    d7c62ed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions