Apply suggestions from code review

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
Jake 2021-08-03 23:07:46 -07:00 committed by GitHub
parent 28b6a30752
commit e01ff775ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -376,7 +376,7 @@ fn highlight_def(db: &RootDatabase, krate: Option<hir::Crate>, def: Definition)
h |= HlMod::Associated;
match func.self_param(db) {
Some(sp) => match sp.access(db) {
hir::Access::Exclusive => h |= HlMod::Mutable,
hir::Access::Exclusive => h = h | HlMod::Mutable | HlMod::Reference,
hir::Access::Shared => h |= HlMod::Reference,
_ => {}
},
@ -555,7 +555,7 @@ fn highlight_method_call(
if let Some(self_param) = func.self_param(sema.db) {
match self_param.access(sema.db) {
hir::Access::Shared => h |= HlMod::Reference,
hir::Access::Exclusive => h |= HlMod::Mutable,
hir::Access::Exclusive => h | HlMod::Mutable | HlMod::Reference,
hir::Access::Owned => {
if let Some(receiver_ty) =
method_call.receiver().and_then(|it| sema.type_of_expr(&it))