From d45d68cd5a4dfcc5b4f6418090be0e870585dda0 Mon Sep 17 00:00:00 2001 From: Benjamin Pollack Date: Wed, 18 Feb 2026 21:25:32 +0000 Subject: [PATCH] fix: resolve clippy warnings from newer Rust toolchain - Allow `mismatched_lifetime_syntaxes` in generated jaffi module. These warnings come from code generated by the jaffi build dependency, not from our source, so suppressing at the include site is appropriate. - Remove unused `JNIExt::as_string` method. - Rename `crate_type` to `crate-type` in Cargo.toml (underscore form is deprecated and will not work in edition 2024). --- ngrok-java-native/Cargo.toml | 2 +- ngrok-java-native/src/lib.rs | 14 +------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/ngrok-java-native/Cargo.toml b/ngrok-java-native/Cargo.toml index 37b05ef..c5ffb2a 100644 --- a/ngrok-java-native/Cargo.toml +++ b/ngrok-java-native/Cargo.toml @@ -21,7 +21,7 @@ tracing-subscriber = { version = "0.3.16", features = ["env-filter"] } url = "2.4.1" [lib] -crate_type = ["cdylib"] +crate-type = ["cdylib"] [patch.crates-io] jaffi_support = { git = 'https://github.com/ngrok-oss/jaffi.git', branch = 'josh/lower-jni-version' } diff --git a/ngrok-java-native/src/lib.rs b/ngrok-java-native/src/lib.rs index 8623a16..6636bc7 100644 --- a/ngrok-java-native/src/lib.rs +++ b/ngrok-java-native/src/lib.rs @@ -45,6 +45,7 @@ use ngrok::{ #[allow(clippy::all)] #[allow(dead_code)] +#[allow(mismatched_lifetime_syntaxes)] mod com_ngrok { include!(concat!(env!("OUT_DIR"), "/generated_jaffi.rs")); } @@ -178,19 +179,6 @@ trait JNIExt<'local> { .expect("cannot take native value") } - fn as_string(&self, jstr: JString) -> Option { - if jstr.is_null() { - None - } else { - Some( - self.get_env() - .get_string(jstr) - .expect("could not convert to string") - .into(), - ) - } - } - fn ngrok_exc_err< T: std::convert::From>, E: NError,