mirror of
https://github.com/isar/rusqlite.git
synced 2025-10-29 21:08:55 +08:00
Cleanup - if let to match
This commit is contained in:
@@ -89,10 +89,10 @@ raw_to_impl!(c_double, sqlite3_bind_double);
|
||||
|
||||
impl<'a> ToSql for &'a str {
|
||||
unsafe fn bind_parameter(&self, stmt: *mut ffi::sqlite3_stmt, col: c_int) -> c_int {
|
||||
if let Ok(c_str) = str_to_cstring(self) {
|
||||
ffi::sqlite3_bind_text(stmt, col, c_str.as_ptr(), -1, Some(ffi::SQLITE_TRANSIENT()))
|
||||
} else {
|
||||
ffi::SQLITE_MISUSE
|
||||
match str_to_cstring(self) {
|
||||
Ok(c_str) => ffi::sqlite3_bind_text(stmt, col, c_str.as_ptr(), -1,
|
||||
Some(ffi::SQLITE_TRANSIENT())),
|
||||
Err(_) => ffi::SQLITE_MISUSE,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user