simpler syntax
This commit is contained in:
parent
4007983cba
commit
4980b3df67
|
@ -192,15 +192,14 @@ impl Database for SqliteDatabase {
|
|||
let mut stmt = self.connection.prepare(query)?;
|
||||
|
||||
let results = stmt.query_map(params, |row| {
|
||||
let x = Ok(Entry {
|
||||
Ok(Entry {
|
||||
id: row.get("id")?,
|
||||
note: row.get("note")?,
|
||||
start: row.get("start")?,
|
||||
end: row.get("end")?,
|
||||
sheet: row.get("sheet")?,
|
||||
});
|
||||
|
||||
x})?.filter_map(|r| r.ok()).collect();
|
||||
})
|
||||
})?.filter_map(|r| r.ok()).collect();
|
||||
|
||||
Ok(results)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue