mirror of
https://github.com/isar/rusqlite.git
synced 2025-04-04 14:32:57 +08:00
commit
983f08b8d7
@ -487,8 +487,8 @@ mod build_linked {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(feature = "buildtime_bindgen"))]
|
#[cfg(not(feature = "buildtime_bindgen"))]
|
||||||
|
#[allow(dead_code)]
|
||||||
mod bindings {
|
mod bindings {
|
||||||
#![allow(dead_code)]
|
|
||||||
use super::HeaderLocation;
|
use super::HeaderLocation;
|
||||||
|
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
@ -463,7 +463,6 @@ tuples_try_from_row!(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P);
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
#![allow(clippy::redundant_closure)] // false positives due to lifetime issues; clippy issue #5594
|
|
||||||
use crate::{Connection, Result};
|
use crate::{Connection, Result};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -385,9 +385,8 @@ mod test {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[allow(clippy::float_cmp)]
|
||||||
fn test_numeric_conversions() -> Result<()> {
|
fn test_numeric_conversions() -> Result<()> {
|
||||||
#![allow(clippy::float_cmp)]
|
|
||||||
|
|
||||||
// Test what happens when we store an f32 and retrieve an i32 etc.
|
// Test what happens when we store an f32 and retrieve an i32 etc.
|
||||||
let db = Connection::open_in_memory()?;
|
let db = Connection::open_in_memory()?;
|
||||||
db.execute_batch("CREATE TABLE foo (x)")?;
|
db.execute_batch("CREATE TABLE foo (x)")?;
|
||||||
|
@ -115,7 +115,7 @@ unsafe impl<'vtab> VTab<'vtab> for CsvTab {
|
|||||||
if !Path::new(value).exists() {
|
if !Path::new(value).exists() {
|
||||||
return Err(Error::ModuleError(format!("file '{value}' does not exist")));
|
return Err(Error::ModuleError(format!("file '{value}' does not exist")));
|
||||||
}
|
}
|
||||||
vtab.filename = value.to_owned();
|
value.clone_into(&mut vtab.filename);
|
||||||
}
|
}
|
||||||
"schema" => {
|
"schema" => {
|
||||||
schema = Some(value.to_owned());
|
schema = Some(value.to_owned());
|
||||||
|
@ -1080,12 +1080,12 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe extern "C" fn rust_open<'vtab, T: 'vtab>(
|
unsafe extern "C" fn rust_open<'vtab, T>(
|
||||||
vtab: *mut ffi::sqlite3_vtab,
|
vtab: *mut ffi::sqlite3_vtab,
|
||||||
pp_cursor: *mut *mut ffi::sqlite3_vtab_cursor,
|
pp_cursor: *mut *mut ffi::sqlite3_vtab_cursor,
|
||||||
) -> c_int
|
) -> c_int
|
||||||
where
|
where
|
||||||
T: VTab<'vtab>,
|
T: VTab<'vtab> + 'vtab,
|
||||||
{
|
{
|
||||||
let vt = vtab.cast::<T>();
|
let vt = vtab.cast::<T>();
|
||||||
match (*vt).open() {
|
match (*vt).open() {
|
||||||
@ -1186,14 +1186,14 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe extern "C" fn rust_update<'vtab, T: 'vtab>(
|
unsafe extern "C" fn rust_update<'vtab, T>(
|
||||||
vtab: *mut ffi::sqlite3_vtab,
|
vtab: *mut ffi::sqlite3_vtab,
|
||||||
argc: c_int,
|
argc: c_int,
|
||||||
argv: *mut *mut ffi::sqlite3_value,
|
argv: *mut *mut ffi::sqlite3_value,
|
||||||
p_rowid: *mut ffi::sqlite3_int64,
|
p_rowid: *mut ffi::sqlite3_int64,
|
||||||
) -> c_int
|
) -> c_int
|
||||||
where
|
where
|
||||||
T: UpdateVTab<'vtab>,
|
T: UpdateVTab<'vtab> + 'vtab,
|
||||||
{
|
{
|
||||||
assert!(argc >= 1);
|
assert!(argc >= 1);
|
||||||
let args = slice::from_raw_parts_mut(argv, argc as usize);
|
let args = slice::from_raw_parts_mut(argv, argc as usize);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user