Skip to content

Commit

Permalink
Resolve uninlined_format_args pedantic clippy lint in test suite
Browse files Browse the repository at this point in the history
    error: variables can be used directly in the `format!` string
        --> test_suite/tests/test_annotations.rs:1238:30
         |
    1238 |     serializer.serialize_str(format!("{};{:?}", f1, f2).as_str())
         |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
         = note: `-D clippy::uninlined-format-args` implied by `-D clippy::pedantic`
    help: change this to
         |
    1238 -     serializer.serialize_str(format!("{};{:?}", f1, f2).as_str())
    1238 +     serializer.serialize_str(format!("{f1};{f2:?}").as_str())
         |
  • Loading branch information
dtolnay committed Oct 8, 2022
1 parent 3ffb86f commit d96e181
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test_suite/tests/test_annotations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@ fn serialize_variant_as_string<S>(f1: &str, f2: &u8, serializer: S) -> Result<S:
where
S: Serializer,
{
serializer.serialize_str(format!("{};{:?}", f1, f2).as_str())
serializer.serialize_str(format!("{f1};{f2:?}").as_str())
}

fn deserialize_string_as_variant<'de, D>(deserializer: D) -> Result<(String, u8), D::Error>
Expand Down

0 comments on commit d96e181

Please sign in to comment.