diff --git a/src/error.rs b/src/error.rs index b8f0356..6cacba6 100644 --- a/src/error.rs +++ b/src/error.rs @@ -334,7 +334,8 @@ impl Display for ErrorCode { } impl serde::de::StdError for Error { - fn source(&self) -> Option<&(serde::de::StdError + 'static)> { + #[cfg(feature = "std")] + fn source(&self) -> Option<&(error::Error + 'static)> { match self.err.code { ErrorCode::Io(ref err) => Some(err), _ => None, diff --git a/src/io/core.rs b/src/io/core.rs index f83f5cf..5ffea38 100644 --- a/src/io/core.rs +++ b/src/io/core.rs @@ -22,8 +22,6 @@ impl Debug for Error { } } -impl serde::de::StdError for Error {} - impl Error { pub(crate) fn new(kind: ErrorKind, error: &'static str) -> Error { let _ = kind;