mirror of
https://github.com/isar/rusqlite.git
synced 2025-10-23 17:28:55 +08:00
Fix clippy warnings
This commit is contained in:
@@ -571,19 +571,19 @@ impl Values<'_> {
|
||||
// `sqlite3_value_type` returns `SQLITE_NULL` for pointer.
|
||||
// So it seems not possible to enhance `ValueRef::from_value`.
|
||||
#[cfg(feature = "array")]
|
||||
fn get_array(&self, idx: usize) -> Result<Option<array::Array>> {
|
||||
fn get_array(&self, idx: usize) -> Option<array::Array> {
|
||||
use crate::types::Value;
|
||||
let arg = self.args[idx];
|
||||
let ptr = unsafe { ffi::sqlite3_value_pointer(arg, array::ARRAY_TYPE) };
|
||||
if ptr.is_null() {
|
||||
Ok(None)
|
||||
None
|
||||
} else {
|
||||
Ok(Some(unsafe {
|
||||
Some(unsafe {
|
||||
let rc = array::Array::from_raw(ptr as *const Vec<Value>);
|
||||
let array = rc.clone();
|
||||
array::Array::into_raw(rc); // don't consume it
|
||||
array
|
||||
}))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user