chiark / gitweb /
currency: Rename value
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 30 Apr 2022 12:10:38 +0000 (13:10 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 30 Apr 2022 14:15:30 +0000 (15:15 +0100)
Having the two pieces here is confusing.  All the variables should say
which piece they are.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/currency.rs

index 6efd91aa825d5949b99db3810f6f79394073da00..4c4704c7927b34f3f18bfd3704497a60e235a2da 100644 (file)
@@ -135,8 +135,8 @@ impl PieceTrait for Banknote {
             tgpc: &mut GPiece, tipc: &IPiece,
             ngpc: &mut GPiece|
   {
-    let value: &mut Value = tgpc.xdata.get_mut_exp()?;
-    let remaining = value.qty.checked_sub(take)
+    let tgpc_value: &mut Value = tgpc.xdata.get_mut_exp()?;
+    let remaining = tgpc_value.qty.checked_sub(take)
       .ok_or(Ia::CurrencyShortfall)?;
 
     tgpc.held = Some(player);