use modify over getting a mutable reference

This commit is contained in:
Folkert 2022-05-20 21:01:50 +02:00
parent 8a361bb68a
commit 4489a308e4
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
4 changed files with 27 additions and 27 deletions

View file

@ -1784,7 +1784,7 @@ impl Subs {
pub fn modify<F>(&mut self, key: Variable, mapper: F)
where
F: Fn(&mut Descriptor),
F: FnOnce(&mut Descriptor),
{
mapper(self.get_ref_mut(key));
}