aboutsummaryrefslogtreecommitdiff
path: root/src/db
diff options
context:
space:
mode:
authorJoris2022-01-09 13:12:45 +0100
committerJoris2022-01-09 13:12:45 +0100
commit99af88a840bef534540a4b273d24a8a17e7fc9b9 (patch)
tree20bda6c9eccd66d0c165e1f5d42fe76f80be58d2 /src/db
parentbd59a5128c05dcd550e91bbdd0cd9d5996a65586 (diff)
Split app into modules
Diffstat (limited to 'src/db')
-rw-r--r--src/db/mod.rs4
1 files changed, 2 insertions, 2 deletions
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<Vec<Event>> {
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())
}