Cleanup - if let to match

This commit is contained in:
John Gallagher
2015-03-10 16:07:38 -04:00
parent d7909c086b
commit 30db1905d3
2 changed files with 7 additions and 8 deletions

View File

@@ -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(),
})