From 07c639048b557bf27126fbced1bb046167326818 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 6 Dec 2020 01:53:00 +0000 Subject: [PATCH] formatting, some from rustfmt (manually picked) Signed-off-by: Ian Jackson --- src/updates.rs | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/updates.rs b/src/updates.rs index 1295c7fe..db1f9e83 100644 --- a/src/updates.rs +++ b/src/updates.rs @@ -301,19 +301,15 @@ impl PieceUpdateOp { } pub struct PrepareUpdatesBuffer<'r> { - g : &'r mut Instance, - us : Vec, - by_client : IsResponseToClientOp, - gen : Option, + g: &'r mut Instance, + us: Vec, + by_client: IsResponseToClientOp, + gen: Option, } /// In PROTOCOL.md terms, None is a Server update -type IsResponseToClientOp = Option<( - WhatResponseToClientOp, - ClientId, - ClientSequence, -)>; -#[derive(Debug,Copy,Clone,Serialize,Deserialize)] +type IsResponseToClientOp = Option<(WhatResponseToClientOp, ClientId, ClientSequence)>; +#[derive(Debug, Copy, Clone, Serialize, Deserialize)] pub enum WhatResponseToClientOp { /// In PROTOCOL.md terms, a Client update Predictable, @@ -361,7 +357,7 @@ impl<'r> PrepareUpdatesBuffer<'r> { let update = match update { PreparedUpdateEntry::Piece { piece, - op : PieceUpdateOp::Modify(state), + op: PieceUpdateOp::Modify(state), .. } => { PreparedUpdateEntry::Error( @@ -530,22 +526,22 @@ impl PreparedUpdate { FTG::Piece => TUE::Piece { piece, op: op.map_ref() }, FTG::Exactly(x) => x, } - }, + } PUE::Log(logent) => { TUE::Log((&tz, &logent)) - }, + } &PUE::SetTableSize(size) => { TUE::SetTableSize(size) - }, + } PUE::SetTableColour(colour) => { TUE::SetTableColour(colour) - }, + } &PUE::AddPlayer { player, ref data } => { TUE::AddPlayer { player, data } - }, + } &PUE::RemovePlayer { player } => { TUE::RemovePlayer { player } - }, + } PUE::Error(c, e) => { if *c == None || *c == Some(dest) { TUE::Error(e) -- 2.30.2