Merge pull request #315 from jwdeitch/master

Allow conversion from de::Error to std::io::error
This commit is contained in:
Alex Crichton 2019-08-12 15:35:55 -05:00 committed by GitHub
commit 7a11ed691a

View file

@ -1823,6 +1823,13 @@ impl Error {
#[doc(hidden)] #[doc(hidden)]
pub fn add_key_context(&mut self, key: &str) { pub fn add_key_context(&mut self, key: &str) {
self.inner.key.insert(0, key.to_string()); self.inner.key.insert(0, key.to_string());
}
}
impl std::convert::From<Error> for std::io::Error {
fn from(e: Error) -> Self {
return std::io::Error::new(std::io::ErrorKind::InvalidData, e.to_string())
} }
fn fix_offset<F>(&mut self, f: F) -> () fn fix_offset<F>(&mut self, f: F) -> ()