mirror of
https://github.com/serde-rs/json.git
synced 2025-10-01 06:51:58 +00:00
Remove source method in no_std mode
An io error can never occur in no_std mode so the source method is never applicable.
This commit is contained in:
parent
cf3beee3d2
commit
def04dedc1
@ -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,
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user