Skip to content

Commit

Permalink
Delegate io::Error::cause to inner error
Browse files Browse the repository at this point in the history
  • Loading branch information
sfackler committed May 28, 2015
1 parent 1a3cffb commit 4458b5a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/libstd/io/error.rs
Expand Up @@ -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() {
Expand Down

0 comments on commit 4458b5a

Please sign in to comment.