From 5f526ef14285b5fd2dc5892d6dd8b307981f743f Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 17 Nov 2024 13:03:17 +0100 Subject: Format sources --- src/cli/mod.rs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/cli') 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 { 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 = 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); } } -- cgit v1.2.3