mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-27 22:04:17 +00:00
Simplify
This commit is contained in:
parent
6d6e0b8f21
commit
b36f12dba5
4 changed files with 112 additions and 184 deletions
|
@ -572,16 +572,7 @@ impl ast::Variant {
|
|||
|
||||
impl ast::Item {
|
||||
pub fn generic_param_list(&self) -> Option<ast::GenericParamList> {
|
||||
match self {
|
||||
ast::Item::Enum(it) => it.generic_param_list(),
|
||||
ast::Item::Fn(it) => it.generic_param_list(),
|
||||
ast::Item::Impl(it) => it.generic_param_list(),
|
||||
ast::Item::Struct(it) => it.generic_param_list(),
|
||||
ast::Item::Trait(it) => it.generic_param_list(),
|
||||
ast::Item::TypeAlias(it) => it.generic_param_list(),
|
||||
ast::Item::Union(it) => it.generic_param_list(),
|
||||
_ => None,
|
||||
}
|
||||
ast::DynGenericParamsOwner::cast(self.syntax().clone())?.generic_param_list()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue