doc: use is_some_and instead of map_or(false, _) (#15455)

see
https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or

changelog: none
This commit is contained in:
Philipp Krones 2025-08-11 11:04:51 +00:00 committed by GitHub
commit 02eb548054
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -141,7 +141,7 @@ impl LateLintPass<'_> for MyStructLint {
// we are looking for the `DefId` of `Drop` trait in lang items
.drop_trait()
// then we use it with our type `ty` by calling `implements_trait` from Clippy's utils
.map_or(false, |id| implements_trait(cx, ty, id, &[])) {
.is_some_and(|id| implements_trait(cx, ty, id, &[])) {
// `expr` implements `Drop` trait
}
}