mirror of
https://github.com/isar/rusqlite.git
synced 2025-09-16 04:32:19 +08:00
Return an error instead of panicing when parameter count is wron… (#675)
Fixes #671
This commit is contained in:
@@ -450,13 +450,11 @@ impl Statement<'_> {
|
||||
}
|
||||
self.bind_parameter(&p, index)?;
|
||||
}
|
||||
assert_eq!(
|
||||
index, expected,
|
||||
"incorrect number of parameters: expected {}, got {}",
|
||||
expected, index
|
||||
);
|
||||
|
||||
Ok(())
|
||||
if index != expected {
|
||||
Err(Error::InvalidParameterCount(expected, index))
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
fn bind_parameters_named(&mut self, params: &[(&str, &dyn ToSql)]) -> Result<()> {
|
||||
|
Reference in New Issue
Block a user