From c83132e477de1d36508c5c4e1e57f6fad1165cfa Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 6 Dec 2020 00:56:43 +0000 Subject: [PATCH] formatting, some from rustfmt (manually picked) Signed-off-by: Ian Jackson --- src/config.rs | 2 +- src/debugreader.rs | 6 +++--- src/error.rs | 10 +++++----- src/gamestate.rs | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/config.rs b/src/config.rs index 536abff6..6cd59259 100644 --- a/src/config.rs +++ b/src/config.rs @@ -155,7 +155,7 @@ impl ServerConfig { impl Default for ServerConfig { fn default() -> ServerConfig { - let spec : ServerConfigSpec = toml_de::from_str(r#" + let spec: ServerConfigSpec = toml_de::from_str(r#" public_url = "INTERNAL ERROR" "#) .expect("parse dummy config as ServerConfigSpec"); diff --git a/src/debugreader.rs b/src/debugreader.rs index cda35723..71ca454d 100644 --- a/src/debugreader.rs +++ b/src/debugreader.rs @@ -5,10 +5,10 @@ use crate::imports::*; #[derive(Debug)] -pub struct DebugReader(pub T, pub ClientId); +pub struct DebugReader(pub T, pub ClientId); -impl Read for DebugReader { - fn read(&mut self, buf: &mut [u8]) -> Result { +impl Read for DebugReader { + fn read(&mut self, buf: &mut [u8]) -> Result { let l = buf.len(); trace!("{} read({})...", &self.1, l); let r = self.0.read(buf); diff --git a/src/error.rs b/src/error.rs index 4ae9748c..e0c93066 100644 --- a/src/error.rs +++ b/src/error.rs @@ -64,14 +64,14 @@ impl From for TokenDeliveryError { a.chain() .map(ToString::to_string) .collect::>() - .join(": ") + .join(": "), ) } } impl From for SpecError { fn from(ie: InternalError) -> SpecError { - SpecError::InternalError(format!("{:?}",ie)) + SpecError::InternalError(format!("{:?}", ie)) } } #[derive(Error,Debug,Serialize,Clone)] @@ -131,13 +131,13 @@ pub trait ById { pub trait IdForById { type Error; #[allow(clippy::declare_interior_mutable_const)] -// https://github.com/rust-lang/rust-clippy/issues/3962#issuecomment-667957112 - const ERROR : Self::Error; + // https://github.com/rust-lang/rust-clippy/issues/3962#issuecomment-667957112 + const ERROR: Self::Error; } macro_rules! some_slotmap { ($slotmap:ident) => { - impl ById for $slotmap { + impl ById for $slotmap { type Id = I; type Entry = T; type Error = ::Error; diff --git a/src/gamestate.rs b/src/gamestate.rs index dcab0298..458408be 100644 --- a/src/gamestate.rs +++ b/src/gamestate.rs @@ -15,7 +15,7 @@ slotmap::new_key_type!{ #[derive(Copy,Clone,Debug,Ord,PartialOrd,Eq,PartialEq)] #[derive(Serialize,Deserialize)] #[serde(transparent)] -pub struct Generation (pub u64); +pub struct Generation(pub u64); visible_slotmap_key!{ VisiblePieceId('.') } -- 2.30.2