aboutsummaryrefslogtreecommitdiff
path: root/src/cli/mod.rs
diff options
context:
space:
mode:
authorJoris2024-11-17 13:03:17 +0100
committerJoris2024-11-17 13:03:17 +0100
commit5f526ef14285b5fd2dc5892d6dd8b307981f743f (patch)
tree8e0ebeda415873ffebcf3ea10130a5ca0e73644e /src/cli/mod.rs
parentfbe6787acb3c844339e34c3bf4509c36281693e6 (diff)
Format sources
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);
}
}