summaryrefslogtreecommitdiffstats
path: root/lib/domain/libimagcalendar/src/store.rs
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2020-03-08 12:06:42 +0100
committerMatthias Beyer <mail@beyermatthias.de>2020-03-08 12:06:42 +0100
commitcb9f6e7f46eb1a05071947d5f28bb1fe45313734 (patch)
tree6e5a8e08e5b204f202de335d412de3f69196ce12 /lib/domain/libimagcalendar/src/store.rs
parent00aa4df88edae1d5eeb3fb365af05f95bd0de3b4 (diff)
parent666193dfc26181b6606cb85de5389c4ed6ece5eb (diff)
Merge branch 'replace-failure-with-anyhow'
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'lib/domain/libimagcalendar/src/store.rs')
-rw-r--r--lib/domain/libimagcalendar/src/store.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/domain/libimagcalendar/src/store.rs b/lib/domain/libimagcalendar/src/store.rs
index e18b8fe1..14d27921 100644
--- a/lib/domain/libimagcalendar/src/store.rs
+++ b/lib/domain/libimagcalendar/src/store.rs
@@ -19,10 +19,11 @@
use std::path::Path;
-use failure::Fallible as Result;
+use anyhow::Result;
use toml::Value;
use toml_query::insert::TomlValueInsertExt;
use vobject::ICalendar;
+use failure::Fail;
use libimagentryutil::isa::Is;
use libimagentryref::reference::Config;
@@ -75,7 +76,8 @@ impl<'a> EventStore<'a> for Store {
Coll: AsRef<str>
{
let text = std::fs::read_to_string(p.as_ref())?;
- Ok(ICalendar::build(&text)?
+ Ok(ICalendar::build(&text)
+ .map_err(|e| e.compat())?
.events()
.filter_map(|rresult| match rresult {
Ok(event) => Some(event),
@@ -86,7 +88,7 @@ impl<'a> EventStore<'a> for Store {
})
.map(|event| {
let uid = event.uid().ok_or_else(|| {
- format_err!("Event in {} has no UID, but icalendar events must have one.", p.as_ref().display())
+ anyhow!("Event in {} has no UID, but icalendar events must have one.", p.as_ref().display())
})?;
let sid = crate::module_path::new_id(uid.raw())?;