mirror of
https://github.com/isar/rusqlite.git
synced 2025-09-16 12:42:18 +08:00
Add Statement.query_row convenient method (#179)
This commit is contained in:
@@ -306,9 +306,7 @@ impl Connection {
|
||||
where F: FnOnce(&Row) -> T
|
||||
{
|
||||
let mut stmt = try!(self.prepare(sql));
|
||||
let mut rows = try!(stmt.query(params));
|
||||
|
||||
rows.get_expected_row().map(|r| f(&r))
|
||||
stmt.query_row(params, f)
|
||||
}
|
||||
|
||||
/// Convenience method to execute a query that is expected to return a single row,
|
||||
|
Reference in New Issue
Block a user