diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/database.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/database.rs b/src/database.rs index a49675f..e4ca5e9 100644 --- a/src/database.rs +++ b/src/database.rs @@ -58,6 +58,7 @@ impl Db { ) -> Result<Repo, Box<dyn std::error::Error>> { let mut tx = self.connection.begin().await?; + // NOTE: Returns `RowNotFound` if not found. let row = sqlx::query("SELECT id, name FROM repositories where id = ?") .bind(id) .fetch_one(&mut tx) @@ -65,10 +66,6 @@ impl Db { tx.commit().await?; - if row.is_empty() { - return Err("not found".into()); - } - Ok( Repo { id: Some(row.get(0)), |