Skip to content

Commit 4458b5a

Browse files
committed
Delegate io::Error::cause to inner error
1 parent 1a3cffb commit 4458b5a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/libstd/io/error.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,13 @@ impl error::Error for Error {
215215
Repr::Custom(ref c) => c.error.description(),
216216
}
217217
}
218+
219+
fn cause(&self) -> Option<&Error> {
220+
match self.repr {
221+
Repr::Os(..) => None,
222+
Repr::Custom(ref c) => c.error.cause(),
223+
}
224+
}
218225
}
219226

220227
fn _assert_error_is_sync_send() {

0 commit comments

Comments
 (0)