Replace serialize_str+format -> collect_str+format_args

This commit is contained in:
David Tolnay 2023-02-02 10:50:34 -08:00
parent 14b0e18c57
commit 07fc9f689e
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.collect_str(&format_args!("{f1};{f2:?}"))
}
fn deserialize_string_as_variant<'de, D>(deserializer: D) -> Result<(String, u8), D::Error>