Skip to content

Commit cd0e4c3

Browse files
committed
Implement Error::source on IntoStringError
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.
1 parent 3da6836 commit cd0e4c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libstd/ffi/c_str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ impl Error for IntoStringError {
919919
"C string contained non-utf8 bytes"
920920
}
921921

922-
fn cause(&self) -> Option<&dyn Error> {
922+
fn source(&self) -> Option<&(dyn Error + 'static)> {
923923
Some(&self.error)
924924
}
925925
}

0 commit comments

Comments
 (0)