mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-27 02:06:57 +00:00
Fix clippy errors
This commit is contained in:
parent
419231c79d
commit
76b93c0d1f
4 changed files with 10 additions and 16 deletions
|
|
@ -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)
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue