From 45de3bedb546e4c075aae967280f7df5373c79b9 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 6 Dec 2020 01:05:25 +0000 Subject: [PATCH] formatting, some from rustfmt (manually picked) Signed-off-by: Ian Jackson --- src/global.rs | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/global.rs b/src/global.rs index 939ed118..4bcd508e 100644 --- a/src/global.rs +++ b/src/global.rs @@ -39,13 +39,13 @@ pub struct InstanceName { pub struct InstanceRef (Arc>); pub struct Instance { - pub name : Arc, - pub gs : GameState, - pub ipieces : PiecesLoaded, - pub clients : DenseSlotMap, - pub iplayers : SecondarySlotMap, - pub tokens_players : TokenRegistry, - pub tokens_clients : TokenRegistry, + pub name: Arc, + pub gs: GameState, + pub ipieces: PiecesLoaded, + pub clients: DenseSlotMap, + pub iplayers: SecondarySlotMap, + pub tokens_players: TokenRegistry, + pub tokens_clients: TokenRegistry, pub acl: LoadedAcl, } @@ -63,20 +63,20 @@ pub struct IPlayerState { #[derive(Debug,Serialize,Deserialize)] #[serde(transparent)] -pub struct PiecesLoaded (ActualPiecesLoaded); -pub type ActualPiecesLoaded = SecondarySlotMap>; +pub struct PiecesLoaded(ActualPiecesLoaded); +pub type ActualPiecesLoaded = SecondarySlotMap>; #[derive(Copy,Clone,Debug)] pub struct ModifyingPieces(()); #[derive(Debug,Serialize,Deserialize,Default)] #[serde(transparent)] -pub struct Pieces (pub(in crate::global) ActualPieces); -type ActualPieces = DenseSlotMap; +pub struct Pieces(pub(in crate::global) ActualPieces); +type ActualPieces = DenseSlotMap; -#[derive(Debug)] +#[derive(Debug)] pub struct Client { - pub player : PlayerId, - pub lastseen : Instant, + pub player: PlayerId, + pub lastseen: Instant, } // KINDS OF PERSISTENT STATE @@ -151,33 +151,33 @@ pub struct Client { // `live` is `false`. #[derive(Debug)] pub struct InstanceGuard<'g> { - pub c : MutexGuard<'g,InstanceContainer>, - pub gref : InstanceRef, + pub c: MutexGuard<'g, InstanceContainer>, + pub gref: InstanceRef, } #[derive(Debug,Default)] pub struct TokenRegistry { - tr : HashSet, - id : PhantomData, + tr: HashSet, + id: PhantomData, } #[derive(Clone,Debug)] pub struct InstanceAccessDetails { - pub gref : InstanceRef, - pub ident : Id, - pub acctid : AccountId, + pub gref: InstanceRef, + pub ident: Id, + pub acctid: AccountId, } #[derive(Clone,Debug)] pub struct InstanceAccess<'i, Id> { - pub raw_token : &'i RawTokenVal, - pub i : InstanceAccessDetails, + pub raw_token: &'i RawTokenVal, + pub i: InstanceAccessDetails, } // ========== internal data structures ========== lazy_static! { - pub static ref GLOBAL : Global = Default::default(); + pub static ref GLOBAL: Global = default(); } #[derive(Default)] -- 2.30.2