diff options
| author | Conrad Ludgate <conradludgate@gmail.com> | 2021-02-14 18:00:41 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-14 18:00:41 +0000 |
| commit | bae59474eef3fd28758a2a4e5e4fb8d50c93a3c4 (patch) | |
| tree | d0c85ade3768dc9b04f6d94c9d9b5c360a17c257 /src/local/database.rs | |
| parent | tidy some stuff (#6) (diff) | |
| download | atuin-bae59474eef3fd28758a2a4e5e4fb8d50c93a3c4.zip | |
a few more tiny touch ups (#7)
* a few more tiny touch ups
* all praise clippy
Diffstat (limited to 'src/local/database.rs')
| -rw-r--r-- | src/local/database.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/local/database.rs b/src/local/database.rs index e2df9ba5..8e4b00ef 100644 --- a/src/local/database.rs +++ b/src/local/database.rs @@ -1,7 +1,7 @@ use chrono::Utc; use std::path::Path; -use eyre::{eyre, Result}; +use eyre::Result; use rusqlite::{params, Connection}; use rusqlite::{Transaction, NO_PARAMS}; @@ -125,16 +125,11 @@ impl Database for Sqlite { where id = ?1", )?; - let mut iter = stmt.query_map(params![id], |row| { + let history = stmt.query_row(params![id], |row| { history_from_sqlite_row(Some(id.to_string()), row) })?; - let history = iter.next().unwrap(); - - match history { - Ok(i) => Ok(i), - Err(e) => Err(eyre!("could not find item: {}", e)), - } + Ok(history) } fn update(&self, h: &History) -> Result<()> { |
