From 54ba133f1e5424eb62eb270ad82db336f516ff81 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 13 Nov 2020 21:20:30 +0000 Subject: [PATCH] rename type alias nfc Signed-off-by: Ian Jackson --- src/bin/otter.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/bin/otter.rs b/src/bin/otter.rs index abf77bed..11d6f2d3 100644 --- a/src/bin/otter.rs +++ b/src/bin/otter.rs @@ -12,7 +12,7 @@ use std::cell::RefCell; use std::cell::Cell; type E = anyhow::Error; -type Insn = MgmtGameInstruction; // xxx MGI +type MGI = MgmtGameInstruction; type AS = AccountScope; type APE = ArgumentParseError; type TP = TablePermission; @@ -374,7 +374,7 @@ const PLAYER_DEFAULT_PERMS : &[TablePermission] = &[ ]; #[throws(AE)] -fn setup_table(_ma: &MainOpts, spec: &TableSpec) -> Vec { +fn setup_table(_ma: &MainOpts, spec: &TableSpec) -> Vec { let TableSpec { players, player_perms, acl } = spec; let mut player_perms = player_perms.clone() .unwrap_or(PLAYER_DEFAULT_PERMS.iter().cloned().collect()); @@ -394,8 +394,8 @@ fn setup_table(_ma: &MainOpts, spec: &TableSpec) -> Vec { let acl = acl.try_into()?; let mut insns = vec![]; - insns.push(Insn::ClearLog); - insns.push(Insn::SetACL { acl }); + insns.push(MGI::ClearLog); + insns.push(MGI::SetACL { acl }); insns } @@ -441,7 +441,7 @@ fn setup_table(_ma: &MainOpts, spec: &TableSpec) -> Vec { if ma.verbose >= 1 { eprintln!("removing old player {:?}", &nick); } - insns.push(Insn::RemovePlayer { player: st.id }); + insns.push(MGI::RemovePlayer { player: st.id }); } let mut added_players = vec![]; @@ -578,12 +578,12 @@ mod reset_game { } if let Some(size) = game.table_size { - insns.push(Insn::SetTableSize(size)); + insns.push(MGI::SetTableSize(size)); } let mut game = game; for pspec in game.pieces.drain(..) { - insns.push(Insn::AddPieces(pspec)); + insns.push(MGI::AddPieces(pspec)); } chan.alter_game(insns, None)?; @@ -720,7 +720,7 @@ mod library_add { #[derive(Debug)] enum Situation { - Poor(Vec, &'static str), + Poor(Vec, &'static str), Good([Pos; 2]), }; use Situation::*; @@ -740,11 +740,11 @@ mod library_add { pinned: Some(false), info: Box::new(spec), }; - Poor(vec![ Insn::AddPieces(spec) ], + Poor(vec![ MGI::AddPieces(spec) ], "marker(s) created") } else if markers.len() > WANTED { let insns = markers[WANTED..].iter() - .map(|p| Insn::DeletePiece(p.piece)) + .map(|p| MGI::DeletePiece(p.piece)) .collect(); Poor(insns, "surplus marker(s) removed") @@ -890,7 +890,7 @@ mod library_add { posd: None, count: Some(1), face: None, pinned: Some(false), info: Box::new(spec), }; - let insn = Insn::AddPieces(spec); + let insn = MGI::AddPieces(spec); insns.push(insn); } -- 2.30.2