Skip to content

Commit cbe7291

Browse files
committed
verification: fix unnecessary lazy evaluations findings
Clippy is flagging a couple instances of this: ``` error: unnecessary closure used with `bool::then` --> src/verification/android.rs:251:18 | 251 | .map(|o| (!o.is_null()).then(|| o)) | ^^^^^^^^^^^^^^^---------- | | | help: use `then_some(..)` instead: `then_some(o)` | ``` This commit applies the recommended fix.
1 parent 2751c09 commit cbe7291

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/verification/android.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ fn extract_result_info(env: &JNIEnv<'_>, result: JObject<'_>) -> (VerifierStatus
248248
let msg = env
249249
.get_field(result, "message", "Ljava/lang/String;")
250250
.and_then(|m| m.l())
251-
.map(|o| (!o.is_null()).then(|| o))
251+
.map(|o| (!o.is_null()).then_some(o))
252252
.and_then(|s| s.map(|s| JavaStr::from_env(env, s.into())).transpose())
253253
.unwrap();
254254

src/verification/windows.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ impl Certificate {
184184
CERT_SET_PROPERTY_IGNORE_PERSIST_ERROR_FLAG,
185185
prop_data,
186186
) == TRUE)
187-
.then(|| ())
187+
.then_some(())
188188
})
189189
}
190190
}

0 commit comments

Comments
 (0)