]> git.lizzy.rs Git - rust.git/commitdiff
Implement Error::source on IntoStringError
authorLinus Färnstrand <faern@faern.net>
Sun, 13 Oct 2019 09:43:26 +0000 (11:43 +0200)
committerLinus Färnstrand <faern@faern.net>
Sun, 13 Oct 2019 09:43:26 +0000 (11:43 +0200)
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.

src/libstd/ffi/c_str.rs

index d7f4cc5d1fdaafc15d572f05c67ce262bd97e771..483f2ba52eca658c5516f27a7e0adab2213d96ef 100644 (file)
@@ -919,7 +919,7 @@ fn description(&self) -> &str {
         "C string contained non-utf8 bytes"
     }
 
-    fn cause(&self) -> Option<&dyn Error> {
+    fn source(&self) -> Option<&(dyn Error + 'static)> {
         Some(&self.error)
     }
 }