mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
Simplify
This commit is contained in:
parent
f8c32df7cd
commit
ea45e54458
5 changed files with 29 additions and 21 deletions
|
@ -426,6 +426,12 @@ impl NameLike {
|
|||
_ => None,
|
||||
}
|
||||
}
|
||||
pub fn as_lifetime(&self) -> Option<&ast::Lifetime> {
|
||||
match self {
|
||||
NameLike::Lifetime(lifetime) => Some(lifetime),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ast::AstNode for NameLike {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue