use crate::imports::*;
+use parking_lot::MappedRwLockReadGuard;
use parking_lot::{const_rwlock, RwLock, RwLockReadGuard};
-use parking_lot::{MappedRwLockReadGuard};
-static STATE : RwLock<Option<State>> = const_rwlock(None);
+static STATE: RwLock<Option<State>> = const_rwlock(None);
struct State {
tera: tera::Tera,
use crate::imports::*;
-type ColourMap = IndexVec<FaceId,Colour>;
+type ColourMap = IndexVec<FaceId, Colour>;
#[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<dyn Outline>,
}
-pub const SELECT_SCALE : f64 = 1.1;
+pub const SELECT_SCALE: f64 = 1.1;
#[derive(Copy,Clone,Debug,Error,Serialize,Deserialize)]
pub enum SVGProcessingError {
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(());
"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;
}
write!(&mut out, "{}", w)?;
}
- trace!("rescaled by {}: {:?} as {:?}",scale,input,&out);
+ trace!("rescaled by {}: {:?} as {:?}", scale, input, &out);
Html(out)
}