Fix clippy errors

This commit is contained in:
Ali Bektas 2025-01-21 23:22:39 +01:00
parent 419231c79d
commit 76b93c0d1f
4 changed files with 10 additions and 16 deletions

View file

@ -1802,10 +1802,10 @@ impl ExprCollector<'_> {
if ident.is_simple_ident() {
return ident
.name()
.and_then(|name| Some(name.as_name()))
.and_then(|hir_name| Some(Path::from(hir_name)))
.and_then(|path| {
Some(self.alloc_expr_from_pat(Expr::Path(path), ptr))
.map(|name| name.as_name())
.map(Path::from)
.map(|path| {
self.alloc_expr_from_pat(Expr::Path(path), ptr)
});
}

View file

@ -56,10 +56,7 @@ impl ExprOrPatId {
}
pub fn is_expr(&self) -> bool {
match self {
Self::ExprId(_) => true,
_ => false,
}
matches!(self, Self::ExprId(_))
}
pub fn as_pat(self) -> Option<PatId> {
@ -70,10 +67,7 @@ impl ExprOrPatId {
}
pub fn is_pat(&self) -> bool {
match self {
Self::PatId(_) => true,
_ => false,
}
matches!(self, Self::PatId(_))
}
}
stdx::impl_from!(ExprId, PatId for ExprOrPatId);