Merge pull request #1473 from gwenn/clippy

Fix clippy warnings
This commit is contained in:
gwenn 2024-03-15 19:31:55 +01:00 committed by GitHub
commit 983f08b8d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 7 additions and 9 deletions

View File

@ -487,8 +487,8 @@ mod build_linked {
}
#[cfg(not(feature = "buildtime_bindgen"))]
#[allow(dead_code)]
mod bindings {
#![allow(dead_code)]
use super::HeaderLocation;
use std::path::Path;

View File

@ -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)]
mod tests {
#![allow(clippy::redundant_closure)] // false positives due to lifetime issues; clippy issue #5594
use crate::{Connection, Result};
#[test]

View File

@ -385,9 +385,8 @@ mod test {
}
#[test]
#[allow(clippy::float_cmp)]
fn test_numeric_conversions() -> Result<()> {
#![allow(clippy::float_cmp)]
// Test what happens when we store an f32 and retrieve an i32 etc.
let db = Connection::open_in_memory()?;
db.execute_batch("CREATE TABLE foo (x)")?;

View File

@ -115,7 +115,7 @@ unsafe impl<'vtab> VTab<'vtab> for CsvTab {
if !Path::new(value).exists() {
return Err(Error::ModuleError(format!("file '{value}' does not exist")));
}
vtab.filename = value.to_owned();
value.clone_into(&mut vtab.filename);
}
"schema" => {
schema = Some(value.to_owned());

View File

@ -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,
pp_cursor: *mut *mut ffi::sqlite3_vtab_cursor,
) -> c_int
where
T: VTab<'vtab>,
T: VTab<'vtab> + 'vtab,
{
let vt = vtab.cast::<T>();
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,
argc: c_int,
argv: *mut *mut ffi::sqlite3_value,
p_rowid: *mut ffi::sqlite3_int64,
) -> c_int
where
T: UpdateVTab<'vtab>,
T: UpdateVTab<'vtab> + 'vtab,
{
assert!(argc >= 1);
let args = slice::from_raw_parts_mut(argv, argc as usize);