From 99af88a840bef534540a4b273d24a8a17e7fc9b9 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 9 Jan 2022 13:12:45 +0100 Subject: Split app into modules --- src/db/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/db') diff --git a/src/db/mod.rs b/src/db/mod.rs index 3348673..6cfa2eb 100644 --- a/src/db/mod.rs +++ b/src/db/mod.rs @@ -23,14 +23,14 @@ pub fn insert(conn: &Connection, event: &Event) -> Result<()> { pub fn list(conn: &Connection) -> Result> { let mut stmt = conn.prepare("SELECT date, start, end, name FROM events")?; - let iter = stmt.query_map([], |row| + let iter = stmt.query_map([], |row| { Ok(Event { date: row.get(0)?, start: row.get(1)?, end: row.get(2)?, name: row.get(3)?, }) - )?; + })?; Ok(iter.map(|r| r.unwrap()).collect()) } -- cgit v1.2.3