chiark / gitweb /
formatting, some from rustfmt (manually picked)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 6 Dec 2020 00:56:43 +0000 (00:56 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 6 Dec 2020 00:56:43 +0000 (00:56 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/config.rs
src/debugreader.rs
src/error.rs
src/gamestate.rs

index 536abff6ef01f473c3d955cf59d5c207cd1faf5b..6cd592591223d171be67d7897584a3c934604b42 100644 (file)
@@ -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");
index cda357239cc11d1266261dcb02c3b1339b776a70..71ca454d5d3d667535e57d62f32b64bb248eda06 100644 (file)
@@ -5,10 +5,10 @@
 use crate::imports::*;
 
 #[derive(Debug)]
-pub struct DebugReader<T : Read>(pub T, pub ClientId);
+pub struct DebugReader<T:Read>(pub T, pub ClientId);
 
-impl<T : Read> Read for DebugReader<T> {
-  fn read(&mut self, buf: &mut [u8]) -> Result<usize,io::Error> {
+impl<T: Read> Read for DebugReader<T> {
+  fn read(&mut self, buf: &mut [u8]) -> Result<usize, io::Error> {
     let l = buf.len();
     trace!("{} read({})...", &self.1, l);
     let r = self.0.read(buf);
index 4ae9748c657f6a75f6411dce837d4353637b3cd2..e0c9306600295e7e235c7b8d03fed92b78b16ec7 100644 (file)
@@ -64,14 +64,14 @@ impl From<anyhow::Error> for TokenDeliveryError {
       a.chain()
         .map(ToString::to_string)
         .collect::<Vec<_>>()
-        .join(": ")
+        .join(": "),
     )
   }
 }
 
 impl From<InternalError> 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<I:IdForById+slotmap::Key, T> ById for $slotmap<I,T> {
+    impl<I: IdForById + slotmap::Key, T> ById for $slotmap<I,T> {
       type Id = I;
       type Entry = T;
       type Error = <I as IdForById>::Error;
index dcab02986e23ff73fb7880ad3268cba151f23453..458408be99f81a47d57c2acb304a5d9236c28ccf 100644 (file)
@@ -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('.') }