Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-db/src/syntax_helpers/node_ext.rs')
-rw-r--r--crates/ide-db/src/syntax_helpers/node_ext.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ide-db/src/syntax_helpers/node_ext.rs b/crates/ide-db/src/syntax_helpers/node_ext.rs
index 91e0b4495f..74c0b8e2ba 100644
--- a/crates/ide-db/src/syntax_helpers/node_ext.rs
+++ b/crates/ide-db/src/syntax_helpers/node_ext.rs
@@ -220,7 +220,7 @@ pub fn vis_eq(this: &ast::Visibility, other: &ast::Visibility) -> bool {
match (this.kind(), other.kind()) {
(VisibilityKind::In(this), VisibilityKind::In(other)) => {
stdx::iter_eq_by(this.segments(), other.segments(), |lhs, rhs| {
- lhs.kind().zip(rhs.kind()).map_or(false, |it| match it {
+ lhs.kind().zip(rhs.kind()).is_some_and(|it| match it {
(PathSegmentKind::CrateKw, PathSegmentKind::CrateKw)
| (PathSegmentKind::SelfKw, PathSegmentKind::SelfKw)
| (PathSegmentKind::SuperKw, PathSegmentKind::SuperKw) => true,
@@ -259,7 +259,7 @@ pub fn is_pattern_cond(expr: ast::Expr) -> bool {
.or_else(|| expr.rhs().map(is_pattern_cond))
.unwrap_or(false)
}
- ast::Expr::ParenExpr(expr) => expr.expr().map_or(false, is_pattern_cond),
+ ast::Expr::ParenExpr(expr) => expr.expr().is_some_and(is_pattern_cond),
ast::Expr::LetExpr(_) => true,
_ => false,
}
@@ -408,7 +408,7 @@ fn for_each_break_expr(
}
pub fn eq_label_lt(lt1: &Option<ast::Lifetime>, lt2: &Option<ast::Lifetime>) -> bool {
- lt1.as_ref().zip(lt2.as_ref()).map_or(false, |(lt, lbl)| lt.text() == lbl.text())
+ lt1.as_ref().zip(lt2.as_ref()).is_some_and(|(lt, lbl)| lt.text() == lbl.text())
}
struct TreeWithDepthIterator {