Skip to content

fix: Fix JNI signature mismatches caused by bind_java_type! JObject m…

d81b3b4
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Open

jni-rs update to v0.22 #462

fix: Fix JNI signature mismatches caused by bind_java_type! JObject m…
d81b3b4
Select commit
Loading
Failed to load commit list.
GitHub Actions / clippy ubuntu-latest failed Apr 27, 2026 in 0s

clippy ubuntu-latest

1 error, 28 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 1
Warning 28
Note 0
Help 0

Versions

  • rustc 1.94.1 (e408947bf 2026-03-25)
  • cargo 1.94.1 (29ea6fb6a 2026-03-24)
  • clippy 0.1.94 (e408947bfd 2026-03-25)

Annotations

Check warning on line 295 in src/droidplug/jni_utils/ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy ubuntu-latest

very complex type used. Consider factoring parts into `type` definitions

warning: very complex type used. Consider factoring parts into `type` definitions
   --> src/droidplug/jni_utils/ops.rs:287:14
    |
287 |       let arc: Arc<
    |  ______________^
288 | |         dyn for<'c, 'd> Fn(
289 | |             &'d mut Env<'c>,
290 | |             JObject<'c>,
...   |
294 | |         ) -> JObject<'c>,
295 | |     > = Arc::from(f);
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#type_complexity
    = note: `#[warn(clippy::type_complexity)]` on by default

Check warning on line 153 in src/droidplug/jni_utils/ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy ubuntu-latest

unneeded unit return type

warning: unneeded unit return type
   --> src/droidplug/jni_utils/ops.rs:153:68
    |
153 |     signature: f: impl for<'c, 'd> Fn(&'d mut Env<'c>, JObject<'c>) -> (),
    |                                                                    ^^^^^^ help: remove the `-> ()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#unused_unit

Check warning on line 153 in src/droidplug/jni_utils/ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy ubuntu-latest

unneeded unit return type

warning: unneeded unit return type
   --> src/droidplug/jni_utils/ops.rs:153:68
    |
153 |     signature: f: impl for<'c, 'd> Fn(&'d mut Env<'c>, JObject<'c>) -> (),
    |                                                                    ^^^^^^ help: remove the `-> ()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#unused_unit

Check warning on line 153 in src/droidplug/jni_utils/ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy ubuntu-latest

unneeded unit return type

warning: unneeded unit return type
   --> src/droidplug/jni_utils/ops.rs:153:68
    |
153 |     signature: f: impl for<'c, 'd> Fn(&'d mut Env<'c>, JObject<'c>) -> (),
    |                                                                    ^^^^^^ help: remove the `-> ()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#unused_unit

Check warning on line 153 in src/droidplug/jni_utils/ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy ubuntu-latest

unneeded unit return type

warning: unneeded unit return type
   --> src/droidplug/jni_utils/ops.rs:153:68
    |
153 |     signature: f: impl for<'c, 'd> Fn(&'d mut Env<'c>, JObject<'c>) -> (),
    |                                                                    ^^^^^^ help: remove the `-> ()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#unused_unit

Check warning on line 153 in src/droidplug/jni_utils/ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy ubuntu-latest

unneeded unit return type

warning: unneeded unit return type
   --> src/droidplug/jni_utils/ops.rs:153:68
    |
153 |     signature: f: impl for<'c, 'd> Fn(&'d mut Env<'c>, JObject<'c>) -> (),
    |                                                                    ^^^^^^ help: remove the `-> ()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#unused_unit

Check warning on line 153 in src/droidplug/jni_utils/ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy ubuntu-latest

unneeded unit return type

warning: unneeded unit return type
   --> src/droidplug/jni_utils/ops.rs:153:68
    |
153 |     signature: f: impl for<'c, 'd> Fn(&'d mut Env<'c>, JObject<'c>) -> (),
    |                                                                    ^^^^^^ help: remove the `-> ()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#unused_unit

Check warning on line 153 in src/droidplug/jni_utils/ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy ubuntu-latest

unneeded unit return type

warning: unneeded unit return type
   --> src/droidplug/jni_utils/ops.rs:153:68
    |
153 |     signature: f: impl for<'c, 'd> Fn(&'d mut Env<'c>, JObject<'c>) -> (),
    |                                                                    ^^^^^^ help: remove the `-> ()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#unused_unit

Check warning on line 153 in src/droidplug/jni_utils/ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy ubuntu-latest

unneeded unit return type

warning: unneeded unit return type
   --> src/droidplug/jni_utils/ops.rs:153:68
    |
153 |     signature: f: impl for<'c, 'd> Fn(&'d mut Env<'c>, JObject<'c>) -> (),
    |                                                                    ^^^^^^ help: remove the `-> ()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#unused_unit

Check warning on line 153 in src/droidplug/jni_utils/ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy ubuntu-latest

unneeded unit return type

warning: unneeded unit return type
   --> src/droidplug/jni_utils/ops.rs:153:68
    |
153 |     signature: f: impl for<'c, 'd> Fn(&'d mut Env<'c>, JObject<'c>) -> (),
    |                                                                    ^^^^^^ help: remove the `-> ()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#unused_unit
    = note: `#[warn(clippy::unused_unit)]` on by default

Check warning on line 75 in src/droidplug/jni_utils/exceptions.rs

See this annotation in the file changed.

@github-actions github-actions / clippy ubuntu-latest

this `if` statement can be collapsed

warning: this `if` statement can be collapsed
  --> src/droidplug/jni_utils/exceptions.rs:62:21
   |
62 | /                     if env.exception_check() {
63 | |                         if let Some(ex) = env.exception_occurred() {
64 | |                             env.exception_clear();
65 | |                             if env.is_instance_of(&ex, class)? {
...  |
75 | |                     }
   | |_____________________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#collapsible_if
   = note: `#[warn(clippy::collapsible_if)]` on by default
help: collapse nested if block
   |
62 ~                     if env.exception_check()
63 ~                         && let Some(ex) = env.exception_occurred() {
64 |                             env.exception_clear();
...
73 |                             }
74 ~                         }
   |

Check warning on line 35 in src/droidplug/jni_utils/exceptions.rs

See this annotation in the file changed.

@github-actions github-actions / clippy ubuntu-latest

try not to call a closure in the expression where it is declared

warning: try not to call a closure in the expression where it is declared
  --> src/droidplug/jni_utils/exceptions.rs:29:21
   |
29 |           try_result: (|| {
   |  _____________________^
30 | |             if env.exception_check() {
31 | |                 Err(Error::JavaException)
32 | |             } else {
...  |
35 | |         })(),
   | |____________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#redundant_closure_call
   = note: `#[warn(clippy::redundant_closure_call)]` on by default
help: try doing something like
   |
29 ~         try_result: (if env.exception_check() {
30 +                 Err(Error::JavaException)
31 +             } else {
32 +                 Ok(block(env))
33 ~             }),
   |

Check warning on line 395 in src/bluez/peripheral.rs

See this annotation in the file changed.

@github-actions github-actions / clippy ubuntu-latest

iterating on a map's values

warning: iterating on a map's values
   --> src/bluez/peripheral.rs:393:22
    |
393 |           descriptors: descriptors
    |  ______________________^
394 | |             .iter()
395 | |             .map(|(_, descriptor)| make_descriptor(descriptor, info.uuid, service_uuid))
    | |________________________________________________________________________________________^ help: try: `descriptors.values().map(|descriptor| make_descriptor(descriptor, info.uuid, service_uuid))`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#iter_kv_map
    = note: `#[warn(clippy::iter_kv_map)]` on by default

Check warning on line 207 in src/bluez/peripheral.rs

See this annotation in the file changed.

@github-actions github-actions / clippy ubuntu-latest

usage of `contains_key` followed by `insert` on a `HashMap`

warning: usage of `contains_key` followed by `insert` on a `HashMap`
   --> src/bluez/peripheral.rs:205:29
    |
205 | / ...                   if !map.contains_key(&characteristic.uuid) {
206 | | ...                       map.insert(characteristic.uuid, characteristic);
207 | | ...                   }
    | |_______________________^ help: try: `map.entry(characteristic.uuid).or_insert(characteristic);`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#map_entry
    = note: `#[warn(clippy::map_entry)]` on by default

Check failure on line 146 in src/bluez/peripheral.rs

See this annotation in the file changed.

@github-actions github-actions / clippy ubuntu-latest

this loop never actually loops

error: this loop never actually loops
   --> src/bluez/peripheral.rs:144:13
    |
144 | /             for (_, characteristic) in service.characteristics.iter() {
145 | |                 return characteristic.info.mtu.unwrap();
146 | |             }
    | |_____________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#never_loop
    = note: `#[deny(clippy::never_loop)]` on by default
help: if you need the first element of the iterator, try writing
    |
144 -             for (_, characteristic) in service.characteristics.iter() {
144 +             if let Some((_, characteristic)) = service.characteristics.iter().next() {
    |

Check warning on line 216 in src/bluez/adapter.rs

See this annotation in the file changed.

@github-actions github-actions / clippy ubuntu-latest

this `match` can be collapsed into the outer `match`

warning: this `match` can be collapsed into the outer `match`
   --> src/bluez/adapter.rs:210:34
    |
210 |           } if id == adapter_id => match adapter_event {
    |  __________________________________^
211 | |             AdapterEvent::Powered { powered } => {
212 | |                 let state = get_central_state(powered);
213 | |                 Some(vec![CentralEvent::StateUpdate(state)])
214 | |             }
215 | |             _ => None,
216 | |         },
    | |_________^
    |
help: the outer pattern can be modified to include the inner pattern
   --> src/bluez/adapter.rs:209:20
    |
209 |             event: adapter_event,
    |                    ^^^^^^^^^^^^^ replace this binding
210 |         } if id == adapter_id => match adapter_event {
211 |             AdapterEvent::Powered { powered } => {
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern, prefixed by `adapter_event: `
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#collapsible_match
    = note: `#[warn(clippy::collapsible_match)]` on by default

Check warning on line 44 in src/droidplug/jni_utils/stream.rs

See this annotation in the file changed.

@github-actions github-actions / clippy ubuntu-latest

associated functions `new` and `from_env` are never used

warning: associated functions `new` and `from_env` are never used
  --> src/droidplug/jni_utils/stream.rs:44:12
   |
43 | impl JSendStream {
   | ---------------- associated functions in this implementation
44 |     pub fn new(env: &mut Env, stream: &JStream) -> Result<Self> {
   |            ^^^
...
51 |     pub fn from_env(env: &mut Env, obj: &JObject) -> Result<Self> {
   |            ^^^^^^^^

Check warning on line 337 in src/droidplug/jni_utils/ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy ubuntu-latest

function `fn_adapter_close_internal` is never used

warning: function `fn_adapter_close_internal` is never used
   --> src/droidplug/jni_utils/ops.rs:337:26
    |
337 | pub(crate) extern "C" fn fn_adapter_close_internal(mut env: EnvUnowned, obj: JObject) {
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 307 in src/droidplug/jni_utils/ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy ubuntu-latest

function `fn_adapter_call_internal` is never used

warning: function `fn_adapter_call_internal` is never used
   --> src/droidplug/jni_utils/ops.rs:307:26
    |
307 | pub(crate) extern "C" fn fn_adapter_call_internal<'local>(
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^

Check warning on line 183 in src/droidplug/jni_utils/ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy ubuntu-latest

function `fn_once_function` is never used

warning: function `fn_once_function` is never used
   --> src/droidplug/jni_utils/ops.rs:183:14
    |
183 |     fn_once: fn_once_function,
    |              ^^^^^^^^^^^^^^^^
    |
    = note: this warning originates in the macro `define_fn_adapter` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 161 in src/droidplug/jni_utils/ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy ubuntu-latest

function `fn_once_bi_function` is never used

warning: function `fn_once_bi_function` is never used
   --> src/droidplug/jni_utils/ops.rs:161:14
    |
161 |     fn_once: fn_once_bi_function,
    |              ^^^^^^^^^^^^^^^^^^^
    |
    = note: this warning originates in the macro `define_fn_adapter` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 40 in src/droidplug/jni_utils/future.rs

See this annotation in the file changed.

@github-actions github-actions / clippy ubuntu-latest

associated functions `new` and `from_env` are never used

warning: associated functions `new` and `from_env` are never used
  --> src/droidplug/jni_utils/future.rs:40:12
   |
39 | impl JSendFuture {
   | ---------------- associated functions in this implementation
40 |     pub fn new(env: &mut Env, future: &JFuture) -> Result<Self> {
   |            ^^^
...
47 |     pub fn from_env(env: &mut Env, obj: &JObject) -> Result<Self> {
   |            ^^^^^^^^

Check warning on line 198 in src/droidplug/jni_utils/exceptions.rs

See this annotation in the file changed.

@github-actions github-actions / clippy ubuntu-latest

function `throw_unwind` is never used

warning: function `throw_unwind` is never used
   --> src/droidplug/jni_utils/exceptions.rs:198:8
    |
198 | pub fn throw_unwind<R>(
    |        ^^^^^^^^^^^^

Check warning on line 166 in src/droidplug/jni_utils/exceptions.rs

See this annotation in the file changed.

@github-actions github-actions / clippy ubuntu-latest

function `throw_panic` is never used

warning: function `throw_panic` is never used
   --> src/droidplug/jni_utils/exceptions.rs:166:8
    |
166 | pub fn throw_panic(
    |        ^^^^^^^^^^^

Check warning on line 41 in src/droidplug/jni_utils/exceptions.rs

See this annotation in the file changed.

@github-actions github-actions / clippy ubuntu-latest

methods `catch` and `result` are never used

warning: methods `catch` and `result` are never used
  --> src/droidplug/jni_utils/exceptions.rs:41:12
   |
40 | impl<T> TryCatchResult<T> {
   | ------------------------- methods in this implementation
41 |     pub fn catch<'local>(
   |            ^^^^^
...
91 |     pub fn result(self) -> Result<T, Error> {
   |            ^^^^^^