mirror of
https://github.com/isar/rusqlite.git
synced 2026-01-03 01:12:25 +08:00
Cleanup - if let to match
This commit is contained in:
@@ -319,10 +319,9 @@ impl SqliteConnection {
|
||||
let mut stmt = try!(self.prepare(sql));
|
||||
let mut rows = try!(stmt.query(params));
|
||||
|
||||
if let Some(row) = rows.next() {
|
||||
row.map(f)
|
||||
} else {
|
||||
Err(SqliteError{
|
||||
match rows.next() {
|
||||
Some(row) => row.map(f),
|
||||
None => Err(SqliteError{
|
||||
code: ffi::SQLITE_NOTICE,
|
||||
message: "Query did not return a row".to_string(),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user