Skip to content

Commit

Permalink
return inner error of std:io::Error as source/cause
Browse files Browse the repository at this point in the history
Proposed solution to close rust-lang#124513

Not sure if this should be seen as a breaking change or not.

See for more context rust-lang#124513.
  • Loading branch information
GlenDC committed Apr 29, 2024
1 parent e27af29 commit 0248c56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/std/src/io/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ impl error::Error for Error {
ErrorData::Os(..) => None,
ErrorData::Simple(..) => None,
ErrorData::SimpleMessage(..) => None,
ErrorData::Custom(c) => c.error.cause(),
ErrorData::Custom(c) => Some(c.error.as_ref()),
}
}

Expand All @@ -1052,7 +1052,7 @@ impl error::Error for Error {
ErrorData::Os(..) => None,
ErrorData::Simple(..) => None,
ErrorData::SimpleMessage(..) => None,
ErrorData::Custom(c) => c.error.source(),
ErrorData::Custom(c) => Some(c.error.as_ref()),
}
}
}
Expand Down

0 comments on commit 0248c56

Please sign in to comment.