Skip to content

Commit

Permalink
Implement Error::source on IntoStringError
Browse files Browse the repository at this point in the history
IntoStringError only implemented Error::cause, which is
deprecated. This implemements Error::source instead.
Error::cause will still work as before, thanks to the default
implementation.
  • Loading branch information
faern committed Oct 13, 2019
1 parent 3da6836 commit cd0e4c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libstd/ffi/c_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ impl Error for IntoStringError {
"C string contained non-utf8 bytes"
}

fn cause(&self) -> Option<&dyn Error> {
fn source(&self) -> Option<&(dyn Error + 'static)> {
Some(&self.error)
}
}
Expand Down

0 comments on commit cd0e4c3

Please sign in to comment.