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
      --> tests/test_generics.rs:93:5
       |
    93 |     assert_eq!(format!("{}", instance), "display only DebugOnly");
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
       |
    93 -     assert_eq!(format!("{}", instance), "display only DebugOnly");
    93 +     assert_eq!(format!("{instance}"), "display only DebugOnly");
       |

    warning: variables can be used directly in the `format!` string
      --> tests/test_generics.rs:96:5
       |
    96 |     assert_eq!(format!("{}", instance), "display only");
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
       |
    96 -     assert_eq!(format!("{}", instance), "display only");
    96 +     assert_eq!(format!("{instance}"), "display only");
       |

    warning: variables can be used directly in the `format!` string
      --> tests/test_generics.rs:99:5
       |
    99 |     assert_eq!(format!("{}", instance), "DebugOnly");
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
       |
    99 -     assert_eq!(format!("{}", instance), "DebugOnly");
    99 +     assert_eq!(format!("{instance}"), "DebugOnly");
       |

    warning: `thiserror` (test "test_generics") generated 3 warnings (run `cargo clippy --fix --test "test_generics"` to apply 3 suggestions)
    warning: variables can be used directly in the `format!` string
       --> tests/test_display.rs:129:20
        |
    129 |         Some(n) => format!("error occurred with {}", n),
        |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
        |
    129 -         Some(n) => format!("error occurred with {}", n),
    129 +         Some(n) => format!("error occurred with {n}"),
        |

    warning: variables can be used directly in the `format!` string
       --> tests/test_display.rs:153:32
        |
    153 |                     Some(n) => write!(formatter, "error occurred with {}", n),
        |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
        |
    153 -                     Some(n) => write!(formatter, "error occurred with {}", n),
    153 +                     Some(n) => write!(formatter, "error occurred with {n}"),
        |
  • Loading branch information
dtolnay committed Sep 2, 2023
1 parent 134695a commit 080cac5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tests/test_display.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::uninlined_format_args)]

use std::fmt::{self, Display};
use thiserror::Error;

Expand Down
2 changes: 1 addition & 1 deletion tests/test_generics.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![allow(clippy::needless_late_init)]
#![allow(clippy::needless_late_init, clippy::uninlined_format_args)]

use std::fmt::{self, Debug, Display};
use thiserror::Error;
Expand Down

0 comments on commit 080cac5

Please sign in to comment.