From 27a2f490b3a88d41606be7fe9c3bc5880e3b55a8 Mon Sep 17 00:00:00 2001 From: Jordan Deitch Date: Thu, 1 Aug 2019 20:43:05 -0400 Subject: convert toml error to std::io error --- src/de.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/de.rs b/src/de.rs index f65492d..49bc78b 100644 --- a/src/de.rs +++ b/src/de.rs @@ -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 for std::io::Error { + fn from(e: Error) -> Self { + return std::io::Error::new(std::io::ErrorKind::InvalidData, e.to_string()) } } -- cgit v1.2.3