From a445485d2090194751f6eea931c290f3d87ef23e Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 6 Dec 2020 01:24:52 +0000 Subject: [PATCH] formatting, some from rustfmt (manually picked) Signed-off-by: Ian Jackson --- src/nwtemplates.rs | 4 ++-- src/pieces.rs | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/nwtemplates.rs b/src/nwtemplates.rs index 117fd2c5..5a647dd6 100644 --- a/src/nwtemplates.rs +++ b/src/nwtemplates.rs @@ -4,10 +4,10 @@ use crate::imports::*; +use parking_lot::MappedRwLockReadGuard; use parking_lot::{const_rwlock, RwLock, RwLockReadGuard}; -use parking_lot::{MappedRwLockReadGuard}; -static STATE : RwLock> = const_rwlock(None); +static STATE: RwLock> = const_rwlock(None); struct State { tera: tera::Tera, diff --git a/src/pieces.rs b/src/pieces.rs index fdf43230..6d63191c 100644 --- a/src/pieces.rs +++ b/src/pieces.rs @@ -6,19 +6,19 @@ use crate::imports::*; -type ColourMap = IndexVec; +type ColourMap = IndexVec; #[derive(Debug,Serialize,Deserialize)] // todo: this serialisation is rather large struct SimpleShape { - desc : Html, - path : Html, - colours : ColourMap, + desc: Html, + path: Html, + colours: ColourMap, itemname: String, outline: Box, } -pub const SELECT_SCALE : f64 = 1.1; +pub const SELECT_SCALE: f64 = 1.1; #[derive(Copy,Clone,Debug,Error,Serialize,Deserialize)] pub enum SVGProcessingError { @@ -59,8 +59,8 @@ pub fn svg_rescale_path(input: &Html, scale: f64) -> Html { r } } - const ALWAYS_MAP : RotatingBitmap = RotatingBitmap::new(0x01, 1); - + const ALWAYS_MAP: RotatingBitmap = RotatingBitmap::new(0x01, 1); + let mut out = String::new(); let mut map = ALWAYS_MAP; let mut first = iter::once(()); @@ -74,7 +74,7 @@ pub fn svg_rescale_path(input: &Html, scale: f64) -> Html { "z" => map.reset(), v if v.starts_with(|s:char| s=='-' || s=='.' || s.is_ascii_digit()) => { if map.next() { - let v : f64 = v.parse()?; + let v: f64 = v.parse()?; write!(&mut out, "{}", v * scale)?; continue; } @@ -84,7 +84,7 @@ pub fn svg_rescale_path(input: &Html, scale: f64) -> Html { write!(&mut out, "{}", w)?; } - trace!("rescaled by {}: {:?} as {:?}",scale,input,&out); + trace!("rescaled by {}: {:?} as {:?}", scale, input, &out); Html(out) } -- 2.30.2