From c1eea9be00d134f5fc0da3c2f6b8122154e38c11 Mon Sep 17 00:00:00 2001 From: gwenn Date: Wed, 11 Oct 2023 18:30:34 +0200 Subject: [PATCH 1/3] Fix clippy warning: arc_with_non_send_sync - interrupt_lock --- src/inner_connection.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/inner_connection.rs b/src/inner_connection.rs index a7487a8..2e535df 100644 --- a/src/inner_connection.rs +++ b/src/inner_connection.rs @@ -40,7 +40,7 @@ pub struct InnerConnection { unsafe impl Send for InnerConnection {} impl InnerConnection { - #[allow(clippy::mutex_atomic)] + #[allow(clippy::mutex_atomic, clippy::arc_with_non_send_sync)] // See unsafe impl Send / Sync for InterruptHandle #[inline] pub unsafe fn new(db: *mut ffi::sqlite3, owned: bool) -> InnerConnection { InnerConnection { From 845761e498d3fdf7f65a64f43c7f2d300c46dbea Mon Sep 17 00:00:00 2001 From: gwenn Date: Wed, 11 Oct 2023 18:49:27 +0200 Subject: [PATCH 2/3] Fix clippy warning redundant_guards --- src/hooks.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hooks.rs b/src/hooks.rs index a069686..52a53a3 100644 --- a/src/hooks.rs +++ b/src/hooks.rs @@ -776,9 +776,10 @@ mod test { .unwrap(); let authorizer = move |ctx: AuthContext<'_>| match ctx.action { - AuthAction::Read { column_name, .. } if column_name == "private" => { - Authorization::Ignore - } + AuthAction::Read { + column_name: "private", + .. + } => Authorization::Ignore, AuthAction::DropTable { .. } => Authorization::Deny, AuthAction::Pragma { .. } => panic!("shouldn't be called"), _ => Authorization::Allow, From 94bba92ba04c0f77d2b58694fa535d665c025980 Mon Sep 17 00:00:00 2001 From: gwenn Date: Wed, 11 Oct 2023 19:01:31 +0200 Subject: [PATCH 3/3] Fix clippy warning unnecessary_cast --- src/functions.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/functions.rs b/src/functions.rs index 6dfcb88..8f34f31 100644 --- a/src/functions.rs +++ b/src/functions.rs @@ -638,6 +638,7 @@ unsafe extern "C" fn call_boxed_step( args: slice::from_raw_parts(argv, argc as usize), }; + #[allow(clippy::unnecessary_cast)] if (*pac as *mut A).is_null() { *pac = Box::into_raw(Box::new((*boxed_aggr).init(&mut ctx)?)); } @@ -708,7 +709,9 @@ where // Within the xFinal callback, it is customary to set N=0 in calls to // sqlite3_aggregate_context(C,N) so that no pointless memory allocations occur. let a: Option = match aggregate_context(ctx, 0) { - Some(pac) => { + Some(pac) => + { + #[allow(clippy::unnecessary_cast)] if (*pac as *mut A).is_null() { None } else { @@ -753,7 +756,9 @@ where // Within the xValue callback, it is customary to set N=0 in calls to // sqlite3_aggregate_context(C,N) so that no pointless memory allocations occur. let a: Option<&A> = match aggregate_context(ctx, 0) { - Some(pac) => { + Some(pac) => + { + #[allow(clippy::unnecessary_cast)] if (*pac as *mut A).is_null() { None } else {