mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-29 06:23:25 +00:00
Apply suggestions from code review
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
parent
0c21d8538c
commit
a1d9e453b9
1 changed files with 5 additions and 9 deletions
|
@ -169,19 +169,15 @@ pub(crate) enum TypeLocation {
|
|||
|
||||
impl TypeLocation {
|
||||
pub(crate) fn complete_lifetimes(&self) -> bool {
|
||||
match self {
|
||||
TypeLocation::GenericArg(Some((_, _, Some(param)))) => {
|
||||
matches!(param, ast::GenericParam::LifetimeParam(_))
|
||||
}
|
||||
_ => false,
|
||||
}
|
||||
matches!(
|
||||
self,
|
||||
TypeLocation::GenericArg(Some((_, _, Some(ast::GenericParam::LifetimeParam(_)))))
|
||||
)
|
||||
}
|
||||
|
||||
pub(crate) fn complete_consts(&self) -> bool {
|
||||
match self {
|
||||
TypeLocation::GenericArg(Some((_, _, Some(param)))) => {
|
||||
matches!(param, ast::GenericParam::ConstParam(_))
|
||||
}
|
||||
TypeLocation::GenericArg(Some((_, _, Some(ast::GenericParam::ConstParam(_))))) => true,
|
||||
TypeLocation::AssocConstEq => true,
|
||||
_ => false,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue