Skip to content

Commit 40e119b

Browse files
wuwbobo2021Dirbaio
authored andcommitted
CI: Add clippy check
1 parent 745d02c commit 40e119b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.github/workflows/rust_nightly.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ jobs:
1717
- uses: actions/checkout@v4
1818
- run: rustup update nightly && rustup default nightly
1919
- run: rustup component add rustfmt
20+
- run: rustup component add clippy
2021
- name: Check fmt
2122
run: cargo fmt -- --check
23+
- name: Clippy
24+
run: cargo clippy -- -Dwarnings
2225
- name: Test
2326
run: cargo test

java-spaghetti/src/refs/ref_.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,10 @@ impl<'env, T: ReferenceType> Ref<'env, T> {
8888
let env = self.env();
8989
let jnienv = env.as_raw();
9090
let class = U::static_with_jni_type(|t| unsafe { env.require_class(t) });
91-
let assignable = unsafe {
92-
let ret = ((**jnienv).v1_2.IsInstanceOf)(jnienv, self.as_raw(), class);
91+
let assignable = unsafe { ((**jnienv).v1_2.IsInstanceOf)(jnienv, self.as_raw(), class) };
92+
unsafe {
9393
((**jnienv).v1_2.DeleteLocalRef)(jnienv, class);
94-
ret
95-
};
94+
}
9695
if assignable { Ok(()) } else { Err(crate::CastError) }
9796
}
9897

0 commit comments

Comments
 (0)