convert toml error to std::io error

This commit is contained in:
Jordan Deitch 2019-08-01 20:43:05 -04:00 committed by GitHub
parent 45361e70b9
commit d3eedc52ba

View file

@ -1769,6 +1769,13 @@ impl Error {
#[doc(hidden)]
pub fn add_key_context(&mut self, key: &str) {
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())
}
}