Skip to content

Commit

Permalink
Ignore uninlined_format_args pedantic clippy lint
Browse files Browse the repository at this point in the history
    warning: variables can be used directly in the `format!` string
      --> src/error.rs:36:25
       |
    36 |             Cargo(e) => write!(f, "failed to execute cargo: {}", e),
       |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = 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: to override `-W clippy::pedantic` add `#[allow(clippy::uninlined_format_args)]`
    help: change this to
       |
    36 -             Cargo(e) => write!(f, "failed to execute cargo: {}", e),
    36 +             Cargo(e) => write!(f, "failed to execute cargo: {e}"),
       |

    warning: variables can be used directly in the `format!` string
      --> src/error.rs:39:24
       |
    39 |             Glob(e) => write!(f, "{}", e),
       |                        ^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
       |
    39 -             Glob(e) => write!(f, "{}", e),
    39 +             Glob(e) => write!(f, "{e}"),
       |

    warning: variables can be used directly in the `format!` string
      --> src/error.rs:40:22
       |
    40 |             Io(e) => write!(f, "{}", e),
       |                      ^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
       |
    40 -             Io(e) => write!(f, "{}", e),
    40 +             Io(e) => write!(f, "{e}"),
       |

    warning: variables can be used directly in the `format!` string
      --> src/error.rs:41:28
       |
    41 |             Metadata(e) => write!(f, "failed to read cargo metadata: {}", e),
       |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
       |
    41 -             Metadata(e) => write!(f, "failed to read cargo metadata: {}", e),
    41 +             Metadata(e) => write!(f, "failed to read cargo metadata: {e}"),
       |

    warning: variables can be used directly in the `format!` string
      --> src/error.rs:45:27
       |
    45 |             Pattern(e) => write!(f, "{}", e),
       |                           ^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
       |
    45 -             Pattern(e) => write!(f, "{}", e),
    45 +             Pattern(e) => write!(f, "{e}"),
       |

    warning: variables can be used directly in the `format!` string
      --> src/error.rs:47:30
       |
    47 |             ReadStderr(e) => write!(f, "failed to read stderr file: {}", e),
       |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
       |
    47 -             ReadStderr(e) => write!(f, "failed to read stderr file: {}", e),
    47 +             ReadStderr(e) => write!(f, "failed to read stderr file: {e}"),
       |

    warning: variables can be used directly in the `format!` string
      --> src/error.rs:52:26
       |
    52 |             TomlDe(e) => write!(f, "{}", e),
       |                          ^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
       |
    52 -             TomlDe(e) => write!(f, "{}", e),
    52 +             TomlDe(e) => write!(f, "{e}"),
       |

    warning: variables can be used directly in the `format!` string
      --> src/error.rs:53:27
       |
    53 |             TomlSer(e) => write!(f, "{}", e),
       |                           ^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
       |
    53 -             TomlSer(e) => write!(f, "{}", e),
    53 +             TomlSer(e) => write!(f, "{e}"),
       |

    warning: variables can be used directly in the `format!` string
      --> src/error.rs:59:31
       |
    59 |             WriteStderr(e) => write!(f, "failed to write stderr file: {}", e),
       |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
       |
    59 -             WriteStderr(e) => write!(f, "failed to write stderr file: {}", e),
    59 +             WriteStderr(e) => write!(f, "failed to write stderr file: {e}"),
       |

    warning: variables can be used directly in the `format!` string
      --> src/expand.rs:59:25
       |
    59 |         let name = Name(format!("trybuild{:03}", index));
       |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
       |
    59 -         let name = Name(format!("trybuild{:03}", index));
    59 +         let name = Name(format!("trybuild{index:03}"));
       |

    warning: variables can be used directly in the `format!` string
       --> src/normalize.rs:205:47
        |
    205 | ...                   let replacement = format!("$OUT_DIR[{}]", out_dir_crate_name);
        |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
        |
    205 -                             let replacement = format!("$OUT_DIR[{}]", out_dir_crate_name);
    205 +                             let replacement = format!("$OUT_DIR[{out_dir_crate_name}]");
        |

    warning: variables can be used directly in the `format!` string
       --> src/run.rs:153:28
        |
    153 |         let project_name = format!("{}-tests", crate_name);
        |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
        |
    153 -         let project_name = format!("{}-tests", crate_name);
    153 +         let project_name = format!("{crate_name}-tests");
        |

    warning: variables can be used directly in the `format!` string
       --> src/run.rs:283:35
        |
    283 |                 enables.insert(0, format!("{}/{}", crate_name, feature));
        |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
        |
    283 -                 enables.insert(0, format!("{}/{}", crate_name, feature));
    283 +                 enables.insert(0, format!("{crate_name}/{feature}"));
        |
  • Loading branch information
dtolnay committed Mar 30, 2024
1 parent 8010acb commit 348f552
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@
clippy::too_many_lines,
clippy::trivially_copy_pass_by_ref,
clippy::uninhabited_references,
clippy::uninlined_format_args,
clippy::unused_self,
clippy::while_let_on_iterator,
)]
Expand Down

0 comments on commit 348f552

Please sign in to comment.