chiark / gitweb /
at-currency: Rename variables
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 1 May 2022 20:08:58 +0000 (21:08 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 1 May 2022 20:08:58 +0000 (21:08 +0100)
This was getting quite confusing.  I think this scheme is less so.

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

index d540662e62168e3d2cafaa33542e8dfc331acacf..67d960b977e6cd1c243f67d46d0ce16befd8cb1e 100644 (file)
@@ -12,31 +12,35 @@ impl Ctx {
     let mut alice = self.connect_player(&self.alice)?;
     let mut a_pieces = alice.pieces::<PIA>()?;
 
-    let bn1 = a_pieces.find_by_desc_glob("*400ƒ*");
+    let bank = a_pieces.find_by_desc_glob("*400ƒ*");
 
-    let other_pile = PosC::new(40,20);
+    let pile_pos = PosC::new(40,20);
     let temp_pos = PosC::new(40,10);
 
-    alice.api_piece_op_single(PuSynch((&mut a_pieces, bn1)).id(), (
+    alice.api_piece_op_single(PuSynch((&mut a_pieces, bank)).id(), (
       "multigrab", json!({ "n": 50, 'z': "q000000000" })
     ))?;
     alice.synchu(&mut a_pieces)?;
 
-    a_pieces[bn1].assert_desc_contains(" 50ƒ");
-    let bn2 = a_pieces.find_by_desc_glob("* 350ƒ*");
+    let pile = bank;
+    let bank = a_pieces.find_by_desc_glob("* 350ƒ*");
+    a_pieces[pile].assert_desc_contains(" 50ƒ");
 
-    alice.api_piece(GH::Ungrab, PuSynch((&mut a_pieces, bn1)), other_pile)?;
+    alice.api_piece(GH::Ungrab, PuSynch((&mut a_pieces, pile)), pile_pos)?;
     alice.synchu(&mut a_pieces)?;
 
-    alice.api_piece_op_single(PuSynch((&mut a_pieces, bn2)).id(), (
+    alice.api_piece_op_single(PuSynch((&mut a_pieces, bank)).id(), (
       "multigrab", json!({ "n": 13, 'z': "t000000000" })
     ))?;
-    alice.api_piece(GH::Ungrab, PuSynch((&mut a_pieces, bn2)), temp_pos)?;
+    let moved = bank;
+    alice.api_piece(GH::Ungrab, PuSynch((&mut a_pieces, moved)), temp_pos)?;
     alice.synchu(&mut a_pieces)?;
-    a_pieces[bn2].assert_desc_contains(" 13ƒ");
-
-    let _bn3 = a_pieces.find_by_desc_glob("* 337ƒ*");
+    let bank = a_pieces.find_by_desc_glob("* 337ƒ*");
+    a_pieces[moved].assert_desc_contains(" 13ƒ");
 
+    let _ = moved;
+    let _ = bank;
+    let _ = pile;
   }
 }