Resolve uninlined_format_args pedantic clippy lint in test suite

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())
         |
This commit is contained in:
David Tolnay 2022-10-07 21:44:57 -07:00
parent 3ffb86fc70
commit d96e181150
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -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>