Apply suggestions from code review
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
@@ -1842,7 +1842,7 @@ impl Local {
|
||||
|
||||
pub fn is_ref(self, db: &dyn HirDatabase) -> bool {
|
||||
let body = db.body(self.parent);
|
||||
matches!(&body[self.pat_id], Pat::Bind { mode: BindingAnnotation::Ref, .. })
|
||||
matches!(&body[self.pat_id], Pat::Bind { mode: BindingAnnotation::Ref | BindingAnnotation::RefMut, .. })
|
||||
}
|
||||
|
||||
pub fn parent(self, _db: &dyn HirDatabase) -> DefWithBody {
|
||||
@@ -2201,7 +2201,7 @@ impl Type {
|
||||
}
|
||||
|
||||
pub fn is_reference(&self) -> bool {
|
||||
matches!(self.ty.kind(&Interner), TyKind::Ref(hir_ty::Mutability::Not, ..))
|
||||
matches!(self.ty.kind(&Interner), TyKind::Ref(..))
|
||||
}
|
||||
|
||||
pub fn is_usize(&self) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user