Implement ser::Error for the value error
This commit is contained in:
parent
d10fa2bd86
commit
6a37472023
@ -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<T>(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> {
|
||||
|
Loading…
Reference in New Issue
Block a user