mirror of
https://github.com/serde-rs/serde.git
synced 2025-10-02 23:35:26 +00:00
Hide some irrelevant detail from de::value::Error's Debug impl
This commit is contained in:
parent
82d0fe00fd
commit
86c88bea12
@ -48,7 +48,7 @@ macro_rules! impl_copy_clone {
|
|||||||
|
|
||||||
/// A minimal representation of all possible errors that can occur using the
|
/// A minimal representation of all possible errors that can occur using the
|
||||||
/// `IntoDeserializer` trait.
|
/// `IntoDeserializer` trait.
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, PartialEq)]
|
||||||
pub struct Error {
|
pub struct Error {
|
||||||
err: ErrorImpl,
|
err: ErrorImpl,
|
||||||
}
|
}
|
||||||
@ -103,6 +103,15 @@ impl Display for Error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Debug for Error {
|
||||||
|
fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||||
|
let mut debug = formatter.debug_tuple("Error");
|
||||||
|
#[cfg(any(feature = "std", feature = "alloc"))]
|
||||||
|
debug.field(&self.err);
|
||||||
|
debug.finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
impl error::Error for Error {
|
impl error::Error for Error {
|
||||||
fn description(&self) -> &str {
|
fn description(&self) -> &str {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user