diff --git a/doc/part-8-items.adoc b/doc/part-8-items.adoc index f6c1108..735dc97 100644 --- a/doc/part-8-items.adoc +++ b/doc/part-8-items.adoc @@ -457,7 +457,7 @@ since it will probably be used multiple times. The constant ---- /// heal by the given amount, without going over the maximum pub fn heal(&mut self, amount: i32) { - if let Some(mut fighter) = self.fighter { + if let Some(ref mut fighter) = self.fighter { fighter.hp += amount; if fighter.hp > fighter.max_hp { fighter.hp = fighter.max_hp; diff --git a/src/bin/part-10-menu-saving.rs b/src/bin/part-10-menu-saving.rs index 3b29b48..5cba8bc 100644 --- a/src/bin/part-10-menu-saving.rs +++ b/src/bin/part-10-menu-saving.rs @@ -206,7 +206,7 @@ impl Object { /// heal by the given amount, without going over the maximum pub fn heal(&mut self, amount: i32) { - if let Some(mut fighter) = self.fighter { + if let Some(ref mut fighter) = self.fighter { fighter.hp += amount; if fighter.hp > fighter.max_hp { fighter.hp = fighter.max_hp; diff --git a/src/bin/part-11-dungeon-progression.rs b/src/bin/part-11-dungeon-progression.rs index 9cdac7c..cd60b48 100644 --- a/src/bin/part-11-dungeon-progression.rs +++ b/src/bin/part-11-dungeon-progression.rs @@ -221,7 +221,7 @@ impl Object { /// heal by the given amount, without going over the maximum pub fn heal(&mut self, amount: i32) { - if let Some(mut fighter) = self.fighter { + if let Some(ref mut fighter) = self.fighter { fighter.hp += amount; if fighter.hp > fighter.max_hp { fighter.hp = fighter.max_hp; diff --git a/src/bin/part-12-monster-item-progression.rs b/src/bin/part-12-monster-item-progression.rs index c61df56..f9b420e 100644 --- a/src/bin/part-12-monster-item-progression.rs +++ b/src/bin/part-12-monster-item-progression.rs @@ -219,7 +219,7 @@ impl Object { /// heal by the given amount, without going over the maximum pub fn heal(&mut self, amount: i32) { - if let Some(mut fighter) = self.fighter { + if let Some(ref mut fighter) = self.fighter { fighter.hp += amount; if fighter.hp > fighter.max_hp { fighter.hp = fighter.max_hp; diff --git a/src/bin/part-13-adventure-gear.rs b/src/bin/part-13-adventure-gear.rs index 827cf2a..2a1b65c 100644 --- a/src/bin/part-13-adventure-gear.rs +++ b/src/bin/part-13-adventure-gear.rs @@ -222,7 +222,7 @@ impl Object { /// heal by the given amount, without going over the maximum pub fn heal(&mut self, amount: i32, game: &Game) { let max_hp = self.max_hp(game); - if let Some(mut fighter) = self.fighter { + if let Some(ref mut fighter) = self.fighter { fighter.hp += amount; if fighter.hp > max_hp { fighter.hp = max_hp; diff --git a/src/bin/part-8-items.rs b/src/bin/part-8-items.rs index 3617190..64469b6 100644 --- a/src/bin/part-8-items.rs +++ b/src/bin/part-8-items.rs @@ -191,7 +191,7 @@ impl Object { /// heal by the given amount, without going over the maximum pub fn heal(&mut self, amount: i32) { - if let Some(mut fighter) = self.fighter { + if let Some(ref mut fighter) = self.fighter { fighter.hp += amount; if fighter.hp > fighter.max_hp { fighter.hp = fighter.max_hp; diff --git a/src/bin/part-9-spells.rs b/src/bin/part-9-spells.rs index 4b329e2..dc6c8e0 100644 --- a/src/bin/part-9-spells.rs +++ b/src/bin/part-9-spells.rs @@ -203,7 +203,7 @@ impl Object { /// heal by the given amount, without going over the maximum pub fn heal(&mut self, amount: i32) { - if let Some(mut fighter) = self.fighter { + if let Some(ref mut fighter) = self.fighter { fighter.hp += amount; if fighter.hp > fighter.max_hp { fighter.hp = fighter.max_hp;