diff options
| author | Steven Fackler <sfackler@gmail.com> | 2015-05-26 20:39:14 -0700 |
|---|---|---|
| committer | Steven Fackler <sfackler@gmail.com> | 2015-05-27 21:53:54 -0700 |
| commit | 4458b5a9d5f11af5cfeb2201a4065131baeeec36 (patch) | |
| tree | c21478c54d5856f1da24ee0b41b7c210c1faeee9 /src/libstd | |
| parent | 1a3cffbddfa21aac6fabd2f07f86703fbf1f26a5 (diff) | |
| download | rust-4458b5a9d5f11af5cfeb2201a4065131baeeec36.tar.gz rust-4458b5a9d5f11af5cfeb2201a4065131baeeec36.zip | |
Delegate io::Error::cause to inner error
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/io/error.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libstd/io/error.rs b/src/libstd/io/error.rs index 97c5a29d308..70e6d7eb265 100644 --- a/src/libstd/io/error.rs +++ b/src/libstd/io/error.rs @@ -215,6 +215,13 @@ impl error::Error for Error { Repr::Custom(ref c) => c.error.description(), } } + + fn cause(&self) -> Option<&Error> { + match self.repr { + Repr::Os(..) => None, + Repr::Custom(ref c) => c.error.cause(), + } + } } fn _assert_error_is_sync_send() { |
