From 4978f800a647e4b88d4010b630ad3c9c4d187156 Mon Sep 17 00:00:00 2001 From: haixuanTao Date: Tue, 9 Jan 2024 21:02:32 +0100 Subject: [PATCH] Fix clippy and rust warnings --- Cargo.lock | 8 ++++---- apis/rust/operator/src/raw.rs | 8 +++++--- apis/rust/operator/types/Cargo.toml | 2 +- binaries/daemon/src/spawn.rs | 3 +-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 518a1d85..0577045c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4881,9 +4881,9 @@ checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" [[package]] name = "safer-ffi" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9c1d19b288ca9898cd421c7b105fb7269918a7f8e9253a991e228981ca421ad" +checksum = "395ace5aff9629c7268ca8255aceb945525b2cb644015f3caec5131a6a537c11" dependencies = [ "inventory 0.1.11", "inventory 0.3.12", @@ -4899,9 +4899,9 @@ dependencies = [ [[package]] name = "safer_ffi-proc_macros" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d7a04caa3ca2224f5ea4ddd850e2629c3b36b2b83621f87a8303bf41020110" +checksum = "9255504d5467bae9e07d58b8de446ba6739b29bf72e1fa35b2387e30d29dcbfe" dependencies = [ "macro_rules_attribute", "prettyplease", diff --git a/apis/rust/operator/src/raw.rs b/apis/rust/operator/src/raw.rs index 9a05a5e3..46aa9638 100644 --- a/apis/rust/operator/src/raw.rs +++ b/apis/rust/operator/src/raw.rs @@ -24,7 +24,7 @@ pub unsafe fn dora_init_operator() -> DoraInitResult { pub unsafe fn dora_drop_operator(operator_context: *mut c_void) -> DoraResult { let raw: *mut O = operator_context.cast(); - unsafe { Box::from_raw(raw) }; + let _ = unsafe { Box::from_raw(raw) }; DoraResult { error: None } } @@ -40,10 +40,12 @@ pub unsafe fn dora_on_event( let event_variant = if let Some(input) = &mut event.input { let Some(data_array) = input.data_array.take() else { return OnEventResult { - result: DoraResult { error: Some("data already taken".to_string().into()) }, + result: DoraResult { + error: Some("data already taken".to_string().into()), + }, status: DoraStatus::Continue, }; - }; + }; let data = arrow::ffi::from_ffi(data_array, &input.schema); match data { diff --git a/apis/rust/operator/types/Cargo.toml b/apis/rust/operator/types/Cargo.toml index 499a02ed..bfc281c4 100644 --- a/apis/rust/operator/types/Cargo.toml +++ b/apis/rust/operator/types/Cargo.toml @@ -13,5 +13,5 @@ arrow = { workspace = true, features = ["ffi"] } dora-arrow-convert = { workspace = true } [dependencies.safer-ffi] -version = "0.1.3" +version = "0.1.4" features = ["headers", "inventory-0-3-1"] diff --git a/binaries/daemon/src/spawn.rs b/binaries/daemon/src/spawn.rs index 1a7e54c3..284899ce 100644 --- a/binaries/daemon/src/spawn.rs +++ b/binaries/daemon/src/spawn.rs @@ -93,8 +93,7 @@ pub async fn spawn_node( } _ => { tracing::info!("spawning: {}", resolved_path.display()); - let cmd = tokio::process::Command::new(&resolved_path); - cmd + tokio::process::Command::new(&resolved_path) } };