mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
Merge #10135
10135: minor: fix some clippy lints r=lnicola a=Veykril bors r+ Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
commit
ac2520128d
23 changed files with 102 additions and 138 deletions
|
@ -60,9 +60,9 @@ impl HasSource for Adt {
|
|||
type Ast = ast::Adt;
|
||||
fn source(self, db: &dyn HirDatabase) -> Option<InFile<Self::Ast>> {
|
||||
match self {
|
||||
Adt::Struct(s) => Some(s.source(db)?.map(|s| ast::Adt::Struct(s))),
|
||||
Adt::Union(u) => Some(u.source(db)?.map(|u| ast::Adt::Union(u))),
|
||||
Adt::Enum(e) => Some(e.source(db)?.map(|e| ast::Adt::Enum(e))),
|
||||
Adt::Struct(s) => Some(s.source(db)?.map(ast::Adt::Struct)),
|
||||
Adt::Union(u) => Some(u.source(db)?.map(ast::Adt::Union)),
|
||||
Adt::Enum(e) => Some(e.source(db)?.map(ast::Adt::Enum)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2960,9 +2960,9 @@ impl ScopeDef {
|
|||
impl From<ItemInNs> for ScopeDef {
|
||||
fn from(item: ItemInNs) -> Self {
|
||||
match item {
|
||||
ItemInNs::Types(id) => ScopeDef::ModuleDef(id.into()),
|
||||
ItemInNs::Values(id) => ScopeDef::ModuleDef(id.into()),
|
||||
ItemInNs::Macros(id) => ScopeDef::MacroDef(id.into()),
|
||||
ItemInNs::Types(id) => ScopeDef::ModuleDef(id),
|
||||
ItemInNs::Values(id) => ScopeDef::ModuleDef(id),
|
||||
ItemInNs::Macros(id) => ScopeDef::MacroDef(id),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -872,7 +872,7 @@ impl<'db> SemanticsImpl<'db> {
|
|||
}
|
||||
|
||||
fn is_unsafe_ident_pat(&self, ident_pat: &ast::IdentPat) -> bool {
|
||||
if !ident_pat.ref_token().is_some() {
|
||||
if ident_pat.ref_token().is_none() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue