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
      --> impl/src/lib.rs:88:17
       |
    88 |                 assert!(len >= 2 && len <= K, "len={}", len);
       |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = 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
       |
    88 -                 assert!(len >= 2 && len <= K, "len={}", len);
    88 +                 assert!(len >= 2 && len <= K, "len={len}");
       |

    warning: variables can be used directly in the `format!` string
       --> impl/src/lib.rs:175:23
        |
    175 |               let msg = format!(
        |  _______________________^
    176 | |                 "serde data model only uses consistently sized integer types, not {}",
    177 | |                 suffix,
    178 | |             );
        | |_____________^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args

    warning: variables can be used directly in the `format!` string
       --> impl/src/lib.rs:182:23
        |
    182 |             let msg = format!("unsupported integers suffix `{}`", suffix);
        |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
        |
    182 -             let msg = format!("unsupported integers suffix `{}`", suffix);
    182 +             let msg = format!("unsupported integers suffix `{suffix}`");
        |

    warning: variables can be used directly in the `format!` string
     --> src/debug.rs:9:9
      |
    9 |         write!(formatter, "MustBe!({:?})", V)
      |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |
      = 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
      |
    9 -         write!(formatter, "MustBe!({:?})", V)
    9 +         write!(formatter, "MustBe!({V:?})")
      |

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

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

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

    warning: variables can be used directly in the `format!` string
      --> src/debug.rs:33:9
       |
    33 |         write!(formatter, "MustBe!({}u16)", V)
       |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
       |
    33 -         write!(formatter, "MustBe!({}u16)", V)
    33 +         write!(formatter, "MustBe!({V}u16)")
       |

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

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

    warning: variables can be used directly in the `format!` string
      --> src/debug.rs:51:9
       |
    51 |         write!(formatter, "MustBe!({}u128)", V)
       |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
       |
    51 -         write!(formatter, "MustBe!({}u128)", V)
    51 +         write!(formatter, "MustBe!({V}u128)")
       |

    warning: variables can be used directly in the `format!` string
      --> src/debug.rs:57:9
       |
    57 |         write!(formatter, "MustBe!({}i8)", V)
       |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
       |
    57 -         write!(formatter, "MustBe!({}i8)", V)
    57 +         write!(formatter, "MustBe!({V}i8)")
       |

    warning: variables can be used directly in the `format!` string
      --> src/debug.rs:63:9
       |
    63 |         write!(formatter, "MustBe!({}i16)", V)
       |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
       |
    63 -         write!(formatter, "MustBe!({}i16)", V)
    63 +         write!(formatter, "MustBe!({V}i16)")
       |

    warning: variables can be used directly in the `format!` string
      --> src/debug.rs:69:9
       |
    69 |         write!(formatter, "MustBe!({}i32)", V)
       |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
       |
    69 -         write!(formatter, "MustBe!({}i32)", V)
    69 +         write!(formatter, "MustBe!({V}i32)")
       |

    warning: variables can be used directly in the `format!` string
      --> src/debug.rs:75:9
       |
    75 |         write!(formatter, "MustBe!({}i64)", V)
       |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
       |
    75 -         write!(formatter, "MustBe!({}i64)", V)
    75 +         write!(formatter, "MustBe!({V}i64)")
       |

    warning: variables can be used directly in the `format!` string
      --> src/debug.rs:81:9
       |
    81 |         write!(formatter, "MustBe!({}i128)", V)
       |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
       |
    81 -         write!(formatter, "MustBe!({}i128)", V)
    81 +         write!(formatter, "MustBe!({V}i128)")
       |

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

    warning: variables can be used directly in the `format!` string
      --> src/deserialize.rs:75:21
       |
    75 |                     write!(writer, "integer `{}`", v).unwrap();
       |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
       |
    75 -                     write!(writer, "integer `{}`", v).unwrap();
    75 +                     write!(writer, "integer `{v}`").unwrap();
       |

    warning: variables can be used directly in the `format!` string
       --> src/deserialize.rs:103:21
        |
    103 |                     write!(writer, "integer `{}`", v).unwrap();
        |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
        |
    103 -                     write!(writer, "integer `{}`", v).unwrap();
    103 +                     write!(writer, "integer `{v}`").unwrap();
        |

    warning: variables can be used directly in the `format!` string
       --> src/deserialize.rs:152:21
        |
    152 |                     write!(writer, "integer `{}`", v).unwrap();
        |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
        |
    152 -                     write!(writer, "integer `{}`", v).unwrap();
    152 +                     write!(writer, "integer `{v}`").unwrap();
        |

    warning: variables can be used directly in the `format!` string
       --> src/deserialize.rs:180:21
        |
    180 |                     write!(writer, "integer `{}`", v).unwrap();
        |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
        |
    180 -                     write!(writer, "integer `{}`", v).unwrap();
    180 +                     write!(writer, "integer `{v}`").unwrap();
        |

    warning: variables can be used directly in the `format!` string
       --> src/deserialize.rs:367:21
        |
    367 |                     write!(writer, "integer `{}`", v).unwrap();
        |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
        |
    367 -                     write!(writer, "integer `{}`", v).unwrap();
    367 +                     write!(writer, "integer `{v}`").unwrap();
        |

    warning: variables can be used directly in the `format!` string
       --> src/deserialize.rs:554:21
        |
    554 |                     write!(writer, "integer `{}`", v).unwrap();
        |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
        |
    554 -                     write!(writer, "integer `{}`", v).unwrap();
    554 +                     write!(writer, "integer `{v}`").unwrap();
        |

    warning: variables can be used directly in the `format!` string
      --> tests/test.rs:70:9
       |
    70 |         assert_eq!(format!("{:?}", must_be), expected);
       |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = 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
       |
    70 -         assert_eq!(format!("{:?}", must_be), expected);
    70 +         assert_eq!(format!("{must_be:?}"), expected);
       |
  • Loading branch information
dtolnay committed Apr 15, 2024
1 parent 7b829d0 commit 58b4704
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
clippy::manual_range_contains,
clippy::match_same_arms,
clippy::needless_pass_by_value,
clippy::uninlined_format_args,
clippy::unnecessary_wraps
)]
#![cfg_attr(all(test, exhaustive), feature(non_exhaustive_omitted_patterns_lint))]
Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
clippy::missing_safety_doc,
clippy::module_name_repetitions,
clippy::ptr_as_ptr,
clippy::uninhabited_references
clippy::uninhabited_references,
clippy::uninlined_format_args
)]

#[doc(hidden)]
Expand Down
6 changes: 5 additions & 1 deletion tests/test.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#![allow(clippy::derive_partial_eq_without_eq, clippy::let_underscore_untyped)]
#![allow(
clippy::derive_partial_eq_without_eq,
clippy::let_underscore_untyped,
clippy::uninlined_format_args
)]

use monostate::MustBe;
use serde::{Deserialize, Serialize};
Expand Down

0 comments on commit 58b4704

Please sign in to comment.