From 4530e403e037773164ecee9942391b75188f64e0 Mon Sep 17 00:00:00 2001 From: Steven Roose Date: Thu, 6 Jun 2019 11:07:41 +0100 Subject: [PATCH] Use collect_str instead of serialize_str in serde macros --- src/internal_macros.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/internal_macros.rs b/src/internal_macros.rs index 7c7534de..473d5c2c 100644 --- a/src/internal_macros.rs +++ b/src/internal_macros.rs @@ -451,7 +451,7 @@ macro_rules! serde_string_impl { where S: $crate::serde::Serializer, { - serializer.serialize_str(&self.to_string()) + serializer.collect_str(&self) } } }; @@ -601,7 +601,7 @@ macro_rules! serde_struct_human_string_impl { S: $crate::serde::Serializer, { if serializer.is_human_readable() { - serializer.serialize_str(&self.to_string()) + serializer.collect_str(&self) } else { use $crate::serde::ser::SerializeStruct; @@ -719,7 +719,7 @@ macro_rules! user_enum { where S: ::serde::Serializer, { - serializer.serialize_str(&self.to_string()) + serializer.collect_str(&self) } } );