diff options
Diffstat (limited to 'lib/core/libimagstore/src/util.rs')
-rw-r--r-- | lib/core/libimagstore/src/util.rs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/core/libimagstore/src/util.rs b/lib/core/libimagstore/src/util.rs index 946cfd94..e113b14c 100644 --- a/lib/core/libimagstore/src/util.rs +++ b/lib/core/libimagstore/src/util.rs @@ -20,10 +20,7 @@ use std::fmt::Write; use toml::Value; -use failure::Fallible as Result; -use failure::ResultExt; - -use libimagerror::errors::ErrorMsg as EM; +use anyhow::Result; #[cfg(feature = "early-panic")] #[macro_export] @@ -55,15 +52,15 @@ pub fn entry_buffer_to_header_content(buf: &str) -> Result<(Value, String)> { header_consumed = true; // do not further process the line } else if !header_consumed { - writeln!(header, "{}", line).context(EM::FormatError)?; + writeln!(header, "{}", line)?; } else if iter.peek().is_some() { - writeln!(content, "{}", line).context(EM::FormatError)?; + writeln!(content, "{}", line)?; } else { - write!(content, "{}", line).context(EM::FormatError)?; + write!(content, "{}", line)?; } } - let h = ::toml::de::from_str(&header).context(EM::TomlDeserError)?; + let h = ::toml::de::from_str(&header)?; Ok((h, content)) } |