From: Ian Jackson Date: Sun, 6 Dec 2020 01:55:38 +0000 (+0000) Subject: formatting, some from rustfmt (manually picked) X-Git-Tag: otter-0.2.0~223 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=e674d76d9a082d09241f3469baa5885d4a028421;p=otter.git formatting, some from rustfmt (manually picked) Signed-off-by: Ian Jackson --- diff --git a/wasm/wasm.rs b/wasm/wasm.rs index 6d7880d6..c213b571 100644 --- a/wasm/wasm.rs +++ b/wasm/wasm.rs @@ -3,12 +3,13 @@ // There is NO WARRANTY. use std::fmt::Display; + use fehler::throws; use js_sys::JsString; use thiserror::Error; use wasm_bindgen::prelude::*; -use zcoord::{ZCoord,Mutable}; +use zcoord::{Mutable,ZCoord}; #[derive(Error,Clone,Copy,Debug,Eq,PartialEq)] #[error("packed Z coordinate wrong JS type (not a string)")] @@ -53,12 +54,12 @@ pub fn increment(packed: &JsValue) -> JsValue { #[wasm_bindgen] pub fn def_zcoord() -> JsValue { - let z : ZCoord = Default::default(); + let z: ZCoord = Default::default(); z.to_string().into() } #[wasm_bindgen] -pub struct ZCoordIterator (zcoord::BoxedIterator); +pub struct ZCoordIterator(zcoord::BoxedIterator); #[throws(JsValue)] #[wasm_bindgen] @@ -74,7 +75,7 @@ pub fn range(a: &JsValue, b: &JsValue, count: zcoord::RangeCount) let a = get1(a)?; let b = get1(b)?; - let inner = Mutable::some_range(a.as_ref(),b.as_ref(),count).e()?; + let inner = Mutable::some_range(a.as_ref(), b.as_ref(), count).e()?; ZCoordIterator(inner) } diff --git a/zcoord/misc.rs b/zcoord/misc.rs index 24152935..842273ea 100644 --- a/zcoord/misc.rs +++ b/zcoord/misc.rs @@ -5,8 +5,8 @@ // This is in this crate for convenience, not because it's to do with // Z coordinates. -use if_chain::if_chain; use arrayvec::ArrayVec; +use if_chain::if_chain; pub fn timestring_abbreviate<'x>(base: &str, this: &'x str) -> (&'x str, bool)