Rename query_named_row -> query_row_named.

I think this is more consistent with Rust's tendency to group similar
methods like `iter`, `iter_mut` by appending the difference as a suffix.
This commit is contained in:
John Gallagher 2015-12-10 20:31:07 -05:00
parent 8d4b3e6a31
commit 186cb5893b

View File

@ -38,7 +38,7 @@ impl SqliteConnection {
/// ///
/// Will return `Err` if `sql` cannot be converted to a C-compatible string or if the /// Will return `Err` if `sql` cannot be converted to a C-compatible string or if the
/// underlying SQLite call fails. /// underlying SQLite call fails.
pub fn query_named_row<T, F>(&self, pub fn query_row_named<T, F>(&self,
sql: &str, sql: &str,
params: &[(&str, &ToSql)], params: &[(&str, &ToSql)],
f: F) f: F)
@ -183,7 +183,7 @@ mod test {
1); 1);
assert_eq!(3i32, assert_eq!(3i32,
db.query_named_row("SELECT SUM(x) FROM foo WHERE x > :x", db.query_row_named("SELECT SUM(x) FROM foo WHERE x > :x",
&[(":x", &0i32)], &[(":x", &0i32)],
|r| r.get(0)) |r| r.get(0))
.unwrap()); .unwrap());
@ -200,7 +200,7 @@ mod test {
stmt.execute_named(&[(":name", &"one")]).unwrap(); stmt.execute_named(&[(":name", &"one")]).unwrap();
assert_eq!(1i32, assert_eq!(1i32,
db.query_named_row("SELECT COUNT(*) FROM test WHERE name = :name", db.query_row_named("SELECT COUNT(*) FROM test WHERE name = :name",
&[(":name", &"one")], &[(":name", &"one")],
|r| r.get(0)) |r| r.get(0))
.unwrap()); .unwrap());