diff options
author | Joris | 2024-11-17 13:03:17 +0100 |
---|---|---|
committer | Joris | 2024-11-17 13:03:17 +0100 |
commit | 5f526ef14285b5fd2dc5892d6dd8b307981f743f (patch) | |
tree | 8e0ebeda415873ffebcf3ea10130a5ca0e73644e /src/cli | |
parent | fbe6787acb3c844339e34c3bf4509c36281693e6 (diff) |
Format sources
Diffstat (limited to 'src/cli')
-rw-r--r-- | src/cli/mod.rs | 19 |
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); } } |