From 48309ff773b083fb87c3950b4876030e61efed2d Mon Sep 17 00:00:00 2001 From: "Mayeul@Zama" <69792125+mayeul-zama@users.noreply.github.com> Date: Tue, 19 Mar 2024 11:48:35 +0100 Subject: [PATCH] fix(c_api): run clippy on high-level-c-api --- Makefile | 2 +- tfhe/src/c_api/high_level_api/threading.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index dd553fa8c..4b8a90e51 100644 --- a/Makefile +++ b/Makefile @@ -252,7 +252,7 @@ clippy: install_rs_check_toolchain .PHONY: clippy_c_api # Run clippy lints enabling the boolean, shortint and the C API clippy_c_api: install_rs_check_toolchain RUSTFLAGS="$(RUSTFLAGS)" cargo "$(CARGO_RS_CHECK_TOOLCHAIN)" clippy \ - --features=$(TARGET_ARCH_FEATURE),boolean-c-api,shortint-c-api \ + --features=$(TARGET_ARCH_FEATURE),boolean-c-api,shortint-c-api,high-level-c-api \ -p $(TFHE_SPEC) -- --no-deps -D warnings .PHONY: clippy_js_wasm_api # Run clippy lints enabling the boolean, shortint, integer and the js wasm API diff --git a/tfhe/src/c_api/high_level_api/threading.rs b/tfhe/src/c_api/high_level_api/threading.rs index f57a865f1..6263e1eb4 100644 --- a/tfhe/src/c_api/high_level_api/threading.rs +++ b/tfhe/src/c_api/high_level_api/threading.rs @@ -93,7 +93,7 @@ pub unsafe extern "C" fn tfhe_threading_context_run( unsafe impl Send for TheUserEnsuresTheFuncIsThreadSafe {} impl TheUserEnsuresTheFuncIsThreadSafe { - fn execute(&mut self, data: TheUserEnsuresDataIsThreadSafe) -> c_int { + fn execute(&mut self, data: &TheUserEnsuresDataIsThreadSafe) -> c_int { (self.0)(data.0) } } @@ -106,7 +106,7 @@ pub unsafe extern "C" fn tfhe_threading_context_run( let panic_result = catch_panic(|| { let context = get_mut_checked(context).unwrap(); - result = context.pool.install(move || func.execute(data)); + result = context.pool.install(move || func.execute(&data)); }); if panic_result != 0 {