aboutsummaryrefslogtreecommitdiff
path: root/src/cli/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli/mod.rs')
-rw-r--r--src/cli/mod.rs19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/cli/mod.rs b/src/cli/mod.rs
index e7439b5..2248fde 100644
--- a/src/cli/mod.rs
+++ b/src/cli/mod.rs
@@ -2,8 +2,8 @@ use anyhow::Result;
use chrono::{Local, NaiveDate, NaiveDateTime, TimeZone};
use rusqlite::Connection;
-use crate::{db, model::event};
use crate::model::event::Event;
+use crate::{db, model::event};
pub fn today(conn: &Connection) -> Result<String> {
let today = Local::now().date_naive();
@@ -33,13 +33,11 @@ pub fn start_between(conn: &Connection, from: NaiveDateTime, to: NaiveDateTime)
println!("{events:?}");
let events: Vec<Event> = events
.iter()
- .filter(|e| {
- match e.start {
- None => false,
- Some(t) => {
- let dt = NaiveDateTime::new(e.date, t);
- dt >= from && dt < to
- }
+ .filter(|e| match e.start {
+ None => false,
+ Some(t) => {
+ let dt = NaiveDateTime::new(e.date, t);
+ dt >= from && dt < to
}
})
.map(|e| e.clone())
@@ -53,7 +51,10 @@ fn between_inclusive(conn: &Connection, from: NaiveDate, to: NaiveDate) -> Resul
let repetitions = event::repetitions_between(&recurring_events, from, to);
for (date, original_events) in repetitions.iter() {
for original_event in original_events {
- let event = Event { date: *date, ..original_event.clone() };
+ let event = Event {
+ date: *date,
+ ..original_event.clone()
+ };
events.push(event);
}
}