From 148cbcd4eed86325d1613f557931247c76b627d1 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 29 Nov 2020 20:59:04 +0000 Subject: [PATCH] make it obvious when new fields are added Signed-off-by: Ian Jackson --- src/bin/otter.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bin/otter.rs b/src/bin/otter.rs index bebb70a9..0448cc73 100644 --- a/src/bin/otter.rs +++ b/src/bin/otter.rs @@ -786,7 +786,10 @@ mod reset_game { game: ma.instance_name(&args.table_name), how: MgmtGameUpdateMode::Bulk, }; - let game: GameSpec = read_spec(&ma, &args.game_file)?; + let GameSpec { + table_size, + pieces, + } = read_spec(&ma, &args.game_file)?; let mut insns = vec![]; @@ -810,12 +813,11 @@ mod reset_game { insns.push(MgmtGameInstruction::DeletePiece(p.piece)); } - if let Some(size) = game.table_size { - insns.push(MGI::SetTableSize(size)); + if let Some(table_size) = table_size { + insns.push(MGI::SetTableSize(table_size)); } - let mut game = game; - for pspec in game.pieces.drain(..) { + for pspec in pieces.into_iter() { insns.push(MGI::AddPieces(pspec)); } -- 2.30.2