mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-24 08:51:07 +00:00
Implement ser::Error for the value error
This commit is contained in:
@@ -39,6 +39,7 @@ use lib::*;
|
|||||||
|
|
||||||
use de::{self, IntoDeserializer, Expected, SeqAccess};
|
use de::{self, IntoDeserializer, Expected, SeqAccess};
|
||||||
use private::de::size_hint;
|
use private::de::size_hint;
|
||||||
|
use ser;
|
||||||
use self::private::{First, Second};
|
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 {
|
impl Display for Error {
|
||||||
#[cfg(any(feature = "std", feature = "collections"))]
|
#[cfg(any(feature = "std", feature = "collections"))]
|
||||||
fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||||
|
|||||||
Reference in New Issue
Block a user