Skip to content

Commit f660aa5

Browse files
committed
formatting
1 parent 883a10b commit f660aa5

2 files changed

Lines changed: 19 additions & 17 deletions

File tree

src/db.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,20 +301,24 @@ impl Database {
301301
i64::try_from(limit.max(1)).map_err(|_| anyhow!("limit value is too large"))?;
302302

303303
let sql = match folder_filter {
304-
Some(_) => r#"
304+
Some(_) => {
305+
r#"
305306
SELECT id, title, status, folder_path, created_at, completed_at
306307
FROM tasks
307308
WHERE status = 'completed' AND folder_path = ?2
308309
ORDER BY completed_at DESC, id DESC
309310
LIMIT ?1
310-
"#,
311-
None => r#"
311+
"#
312+
}
313+
None => {
314+
r#"
312315
SELECT id, title, status, folder_path, created_at, completed_at
313316
FROM tasks
314317
WHERE status = 'completed'
315318
ORDER BY completed_at DESC, id DESC
316319
LIMIT ?1
317-
"#,
320+
"#
321+
}
318322
};
319323

320324
let mut stmt = self.conn.prepare(sql)?;

src/main.rs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ use anyhow::{Result, bail};
22
use clap::{Parser, Subcommand};
33
use demand::DemandOption;
44
use tody::config::{AppConfig, DefaultView};
5-
use tody::db::{Database, ListFilter, ScopeFilter, StatusFilter, project_name, try_resolve_project_path};
5+
use tody::db::{
6+
Database, ListFilter, ScopeFilter, StatusFilter, project_name, try_resolve_project_path,
7+
};
68
use tody::ui;
79

810
#[derive(Parser)]
@@ -329,18 +331,14 @@ fn cmd_list(global: bool, local: bool, all: bool, done: bool) -> Result<()> {
329331
})?;
330332

331333
let header = match scope {
332-
ScopeFilter::LocalCurrent => {
333-
project_folder
334-
.as_deref()
335-
.map(|p| project_name(std::path::Path::new(p)))
336-
.unwrap_or_else(|| "Tasks".into())
337-
}
338-
ScopeFilter::MergedCurrent => {
339-
project_folder
340-
.as_deref()
341-
.map(|p| format!("{} + Global", project_name(std::path::Path::new(p))))
342-
.unwrap_or_else(|| "Tasks".into())
343-
}
334+
ScopeFilter::LocalCurrent => project_folder
335+
.as_deref()
336+
.map(|p| project_name(std::path::Path::new(p)))
337+
.unwrap_or_else(|| "Tasks".into()),
338+
ScopeFilter::MergedCurrent => project_folder
339+
.as_deref()
340+
.map(|p| format!("{} + Global", project_name(std::path::Path::new(p))))
341+
.unwrap_or_else(|| "Tasks".into()),
344342
ScopeFilter::GlobalOnly => "Global Tasks".into(),
345343
ScopeFilter::MergedAll => "All Tasks".into(),
346344
ScopeFilter::LocalAll => "All Project Tasks".into(),

0 commit comments

Comments
 (0)