Skip to content

Commit 60bc445

Browse files
committed
clippy
1 parent 99f8952 commit 60bc445

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

macros/src/test.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ impl DatabaseFunction {
221221
quote! {(|#arg_name: #arg_ty| #block)(#arg_name);}
222222
};
223223

224-
let tmp_db_builder_args = self.args.get_tmp_db_builder(&fn_name, &arg_ty, mvcc);
224+
let tmp_db_builder_args = self.args.get_tmp_db_builder(&fn_name, arg_ty, mvcc);
225225

226226
quote! {
227227
#[test]
@@ -270,7 +270,7 @@ fn check_fn_inputs(input: &ItemFn) -> syn::Result<(Pat, syn::Type)> {
270270
}
271271
let first = args.first().unwrap();
272272
match first {
273-
syn::FnArg::Receiver(receiver) => return Err(syn::Error::new_spanned(receiver, msg)),
273+
syn::FnArg::Receiver(receiver) => Err(syn::Error::new_spanned(receiver, msg)),
274274
syn::FnArg::Typed(pat_type) => {
275275
if let Type::Path(type_path) = pat_type.ty.as_ref() {
276276
// Check if qself is None (not a qualified path like <T as Trait>::Type)
@@ -282,17 +282,17 @@ fn check_fn_inputs(input: &ItemFn) -> syn::Result<(Pat, syn::Type)> {
282282
// This works for both:
283283
// - Simple: TempDatabase
284284
// - Qualified: crate::TempDatabase, my_module::TempDatabase
285-
if !type_path
285+
if type_path
286286
.path
287287
.segments
288288
.last()
289-
.is_some_and(|segment| segment.ident == "TempDatabase")
289+
.is_none_or(|segment| segment.ident != "TempDatabase")
290290
{
291291
return Err(syn::Error::new_spanned(type_path, msg));
292292
}
293293
Ok((*pat_type.pat.clone(), *pat_type.ty.clone()))
294294
} else {
295-
return Err(syn::Error::new_spanned(pat_type, msg));
295+
Err(syn::Error::new_spanned(pat_type, msg))
296296
}
297297
}
298298
}

tests/integration/common.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ impl TempDatabase {
184184
.unwrap()
185185
}
186186

187+
#[allow(dead_code)]
187188
#[cfg(feature = "test_helper")]
188189
pub fn get_pending_byte() -> u32 {
189190
let pending_byte_sqlite = unsafe {
@@ -194,6 +195,7 @@ impl TempDatabase {
194195
pending_byte_turso
195196
}
196197

198+
#[allow(dead_code)]
197199
#[cfg(feature = "test_helper")]
198200
pub fn set_pending_byte(offset: u32) {
199201
unsafe {
@@ -202,6 +204,7 @@ impl TempDatabase {
202204
Database::set_pending_byte(offset);
203205
}
204206

207+
#[allow(dead_code)]
205208
#[cfg(feature = "test_helper")]
206209
pub fn reset_pending_byte() {
207210
// 1 Gib

0 commit comments

Comments
 (0)