Replace bool::to_string with if

This commit is contained in:
David Tolnay 2024-09-04 15:27:48 -07:00
parent d254281184
commit 1faf3a1db6
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -486,7 +486,7 @@ impl serde::Serializer for MapKeySerializer {
} }
fn serialize_bool(self, value: bool) -> Result<String> { fn serialize_bool(self, value: bool) -> Result<String> {
Ok(value.to_string()) Ok(if value { "true" } else { "false" }.to_owned())
} }
fn serialize_i8(self, value: i8) -> Result<String> { fn serialize_i8(self, value: i8) -> Result<String> {