From 156893d774b4da5b541fdbb08428f9ec392949a0 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Sun, 25 Apr 2021 18:21:52 +0100 Subject: Update docs, unify on SQLx, bugfixes (#40) * Begin moving to sqlx for local too * Stupid scanners should just have a nice cup of tea Random internet shit searching for /.env or whatever * Remove diesel and rusqlite fully --- src/command/stats.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/command/stats.rs') diff --git a/src/command/stats.rs b/src/command/stats.rs index 5c9a9dbb..6aa54a2c 100644 --- a/src/command/stats.rs +++ b/src/command/stats.rs @@ -71,7 +71,11 @@ fn compute_stats(history: &[History]) -> Result<()> { } impl Cmd { - pub fn run(&self, db: &mut impl Database, settings: &Settings) -> Result<()> { + pub async fn run( + &self, + db: &mut (impl Database + Send + Sync), + settings: &Settings, + ) -> Result<()> { match self { Self::Day { words } => { let words = if words.is_empty() { @@ -86,7 +90,7 @@ impl Cmd { }; let end = start + Duration::days(1); - let history = db.range(start.into(), end.into())?; + let history = db.range(start.into(), end.into()).await?; compute_stats(&history)?; @@ -94,7 +98,7 @@ impl Cmd { } Self::All => { - let history = db.list(None, false)?; + let history = db.list(None, false).await?; compute_stats(&history)?; -- cgit v1.3.1