mirror of
				https://github.com/isar/rusqlite.git
				synced 2025-11-04 08:08:55 +08:00 
			
		
		
		
	Update query_row_named so its closure also takes a &Row instead of a Row
This commit is contained in:
		@@ -38,12 +38,12 @@ impl Connection {
 | 
			
		||||
    /// Will return `Err` if `sql` cannot be converted to a C-compatible string or if the
 | 
			
		||||
    /// underlying SQLite call fails.
 | 
			
		||||
    pub fn query_row_named<T, F>(&self, sql: &str, params: &[(&str, &ToSql)], f: F) -> Result<T>
 | 
			
		||||
        where F: FnOnce(Row) -> T
 | 
			
		||||
        where F: FnOnce(&Row) -> T
 | 
			
		||||
    {
 | 
			
		||||
        let mut stmt = try!(self.prepare(sql));
 | 
			
		||||
        let mut rows = try!(stmt.query_named(params));
 | 
			
		||||
 | 
			
		||||
        rows.get_expected_row().map(f)
 | 
			
		||||
        rows.get_expected_row().map(|r| f(&r))
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user