aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/remind
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/remind')
-rw-r--r--src/plugins/remind/mod.rs6
-rw-r--r--src/plugins/remind/parser.rs6
2 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/remind/mod.rs b/src/plugins/remind/mod.rs
index 1e464b4..b03aebc 100644
--- a/src/plugins/remind/mod.rs
+++ b/src/plugins/remind/mod.rs
@@ -140,7 +140,8 @@ impl<T: Database + 'static, C: FrippyClient> Remind<T, C> {
debug!("New event: {:?}", event);
- Ok(self.events
+ Ok(self
+ .events
.write()
.insert_event(&event)
.map(|id| format!("Created reminder with id {} at {} UTC", id, time))?)
@@ -168,7 +169,8 @@ impl<T: Database + 'static, C: FrippyClient> Remind<T, C> {
.remove(0)
.parse::<i64>()
.context(ErrorKind::Parsing)?;
- let event = self.events
+ let event = self
+ .events
.read()
.get_event(id)
.context(ErrorKind::NotFound)?;
diff --git a/src/plugins/remind/parser.rs b/src/plugins/remind/parser.rs
index 965ad99..b9682df 100644
--- a/src/plugins/remind/parser.rs
+++ b/src/plugins/remind/parser.rs
@@ -204,7 +204,8 @@ impl CommandParser {
now.tm_year + 1900,
now.tm_mon as u32 + 1,
now.tm_mday as u32,
- ).ok_or(ErrorKind::InvalidDate)?;
+ )
+ .ok_or(ErrorKind::InvalidDate)?;
let time_today = today.and_time(time);
@@ -219,7 +220,8 @@ impl CommandParser {
}
}
} else {
- Ok(date.expect("At this point date has to be set")
+ Ok(date
+ .expect("At this point date has to be set")
.and_hms(0, 0, 0))
}
}