convert toml error to std::io error
@@ -1770,6 +1770,13 @@ impl Error {
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())
+ }
}
impl fmt::Display for Error {
