diff --git a/serde/src/de/value.rs b/serde/src/de/value.rs index 06e50414..c52b86c9 100644 --- a/serde/src/de/value.rs +++ b/serde/src/de/value.rs @@ -39,6 +39,7 @@ use lib::*; use de::{self, IntoDeserializer, Expected, SeqAccess}; use private::de::size_hint; +use ser; use self::private::{First, Second}; //////////////////////////////////////////////////////////////////////////////// @@ -74,6 +75,15 @@ impl de::Error for Error { } } +impl ser::Error for Error { + fn custom(msg: T) -> Self + where + T: Display, + { + de::Error::custom(msg) + } +} + impl Display for Error { #[cfg(any(feature = "std", feature = "collections"))] fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> {