From 186cb5893bae2d338d6bc5f018d46433d9a40d7e Mon Sep 17 00:00:00 2001 From: John Gallagher Date: Thu, 10 Dec 2015 20:31:07 -0500 Subject: [PATCH] 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. --- src/named_params.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/named_params.rs b/src/named_params.rs index 8df8e96..5a8e7b7 100644 --- a/src/named_params.rs +++ b/src/named_params.rs @@ -38,7 +38,7 @@ impl SqliteConnection { /// /// Will return `Err` if `sql` cannot be converted to a C-compatible string or if the /// underlying SQLite call fails. - pub fn query_named_row(&self, + pub fn query_row_named(&self, sql: &str, params: &[(&str, &ToSql)], f: F) @@ -183,7 +183,7 @@ mod test { 1); 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)], |r| r.get(0)) .unwrap()); @@ -200,7 +200,7 @@ mod test { stmt.execute_named(&[(":name", &"one")]).unwrap(); 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")], |r| r.get(0)) .unwrap());