Apply suggestions from code review

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
Max Heller 2023-08-08 11:06:54 -04:00
parent 0c21d8538c
commit a1d9e453b9

View File

@ -169,19 +169,15 @@ pub(crate) enum TypeLocation {
impl TypeLocation { impl TypeLocation {
pub(crate) fn complete_lifetimes(&self) -> bool { pub(crate) fn complete_lifetimes(&self) -> bool {
match self { matches!(
TypeLocation::GenericArg(Some((_, _, Some(param)))) => { self,
matches!(param, ast::GenericParam::LifetimeParam(_)) TypeLocation::GenericArg(Some((_, _, Some(ast::GenericParam::LifetimeParam(_)))))
} )
_ => false,
}
} }
pub(crate) fn complete_consts(&self) -> bool { pub(crate) fn complete_consts(&self) -> bool {
match self { match self {
TypeLocation::GenericArg(Some((_, _, Some(param)))) => { TypeLocation::GenericArg(Some((_, _, Some(ast::GenericParam::ConstParam(_))))) => true,
matches!(param, ast::GenericParam::ConstParam(_))
}
TypeLocation::AssocConstEq => true, TypeLocation::AssocConstEq => true,
_ => false, _ => false,
} }