about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2024-10-05 01:05:24 +0200
committerSamuel Tardieu <sam@rfc1149.net>2024-10-29 11:55:13 +0100
commitf2f73f9c9c4dab531bb279da4b904e57fbd84cfe (patch)
tree8d92901022179f55e723d10d0ce9c7baa0919c32
parent625d391107d2c8bffe7808a6f66564591821a160 (diff)
downloadrust-f2f73f9c9c4dab531bb279da4b904e57fbd84cfe.tar.gz
rust-f2f73f9c9c4dab531bb279da4b904e57fbd84cfe.zip
Replace `.map(…).any(identity)` by `.any(…)`
-rw-r--r--clippy_lints/src/casts/unnecessary_cast.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/clippy_lints/src/casts/unnecessary_cast.rs b/clippy_lints/src/casts/unnecessary_cast.rs
index 811d33c8bde..abd80abffe6 100644
--- a/clippy_lints/src/casts/unnecessary_cast.rs
+++ b/clippy_lints/src/casts/unnecessary_cast.rs
@@ -268,8 +268,7 @@ fn is_cast_from_ty_alias<'tcx>(cx: &LateContext<'tcx>, expr: impl Visitable<'tcx
                 if !snippet
                     .split("->")
                     .skip(1)
-                    .map(|s| snippet_eq_ty(s, cast_from) || s.split("where").any(|ty| snippet_eq_ty(ty, cast_from)))
-                    .any(|a| a)
+                    .any(|s| snippet_eq_ty(s, cast_from) || s.split("where").any(|ty| snippet_eq_ty(ty, cast_from)))
                 {
                     return ControlFlow::Break(());
                 }