1
Fork 0

Address review comments

This commit is contained in:
Jules Bertholet 2024-04-14 10:52:37 -04:00
parent e3945bd3a8
commit 88cd821e62
No known key found for this signature in database
GPG key ID: 32034DAFC38C1BFC
2 changed files with 7 additions and 5 deletions

View file

@ -734,8 +734,8 @@ impl BindingAnnotation {
}
pub fn cap_ref_mutability(mut self, mutbl: Mutability) -> Self {
if let ByRef::Yes(old_mutbl) = self.0 {
self.0 = ByRef::Yes(cmp::min(old_mutbl, mutbl));
if let ByRef::Yes(old_mutbl) = &mut self.0 {
*old_mutbl = cmp::min(*old_mutbl, mutbl);
}
self
}