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.
This commit is contained in:
Linus Färnstrand 2019-10-13 11:43:26 +02:00
parent 3da6836cc9
commit cd0e4c3263

View File

@ -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)
}
}