diff --git a/serde/src/export.rs b/serde/src/export.rs index 805f45ab..80dcb7f5 100644 --- a/serde/src/export.rs +++ b/serde/src/export.rs @@ -9,7 +9,7 @@ pub use lib::result::Result::{self, Err, Ok}; pub use self::string::from_utf8_lossy; #[cfg(any(feature = "alloc", feature = "std"))] -pub use lib::Vec; +pub use lib::{ToString, Vec}; mod string { use lib::*; diff --git a/serde_derive/src/de.rs b/serde_derive/src/de.rs index 4c788845..2fa366e3 100644 --- a/serde_derive/src/de.rs +++ b/serde_derive/src/de.rs @@ -2059,7 +2059,7 @@ fn deserialize_identifier( ) = if collect_other_fields { ( Some(quote! { - let __value = _serde::private::de::Content::String(__value.to_string()); + let __value = _serde::private::de::Content::String(_serde::export::ToString::to_string(__value)); }), Some(quote! { let __value = _serde::private::de::Content::Str(__value);