Rename bind_named_parameters -> bind_parameters_named.

This commit is contained in:
John Gallagher 2015-12-10 20:49:47 -05:00
parent 0051ff47a6
commit 599e30f372

View File

@ -88,7 +88,7 @@ impl<'conn> SqliteStatement<'conn> {
/// Will return `Err` if binding parameters fails, the executed statement returns rows (in /// Will return `Err` if binding parameters fails, the executed statement returns rows (in
/// which case `query` should be used instead), or the underling SQLite call fails. /// which case `query` should be used instead), or the underling SQLite call fails.
pub fn execute_named(&mut self, params: &[(&str, &ToSql)]) -> SqliteResult<c_int> { pub fn execute_named(&mut self, params: &[(&str, &ToSql)]) -> SqliteResult<c_int> {
try!(self.bind_named_parameters(params)); try!(self.bind_parameters_named(params));
unsafe { unsafe {
self.execute_() self.execute_()
} }
@ -118,13 +118,13 @@ impl<'conn> SqliteStatement<'conn> {
params: &[(&str, &ToSql)]) params: &[(&str, &ToSql)])
-> SqliteResult<SqliteRows<'a>> { -> SqliteResult<SqliteRows<'a>> {
self.reset_if_needed(); self.reset_if_needed();
try!(self.bind_named_parameters(params)); try!(self.bind_parameters_named(params));
self.needs_reset = true; self.needs_reset = true;
Ok(SqliteRows::new(self)) Ok(SqliteRows::new(self))
} }
fn bind_named_parameters(&mut self, params: &[(&str, &ToSql)]) -> SqliteResult<()> { fn bind_parameters_named(&mut self, params: &[(&str, &ToSql)]) -> SqliteResult<()> {
// Always check that the number of parameters is correct. // Always check that the number of parameters is correct.
assert!(params.len() as c_int == unsafe { ffi::sqlite3_bind_parameter_count(self.stmt) }, assert!(params.len() as c_int == unsafe { ffi::sqlite3_bind_parameter_count(self.stmt) },
"incorrect number of parameters to query(): expected {}, got {}", "incorrect number of parameters to query(): expected {}, got {}",