diff --git a/dyesub-tool/src/main.rs b/dyesub-tool/src/main.rs index fc4ae75..84e1558 100644 --- a/dyesub-tool/src/main.rs +++ b/dyesub-tool/src/main.rs @@ -1,5 +1,5 @@ -pub mod svg; mod render; +pub mod svg; use sycamore::prelude::*; @@ -13,13 +13,18 @@ fn Slider(cx: Scope) -> View { } fn main() { - sycamore::render_to(|cx| view! { cx, - Slider - Slider - Slider - }, { - let window = web_sys::window().unwrap(); - let document = window.document().unwrap(); - &document.query_selector("main").unwrap().unwrap() - }); + sycamore::render_to( + |cx| { + view! { cx, + Slider + Slider + Slider + } + }, + { + let window = web_sys::window().unwrap(); + let document = window.document().unwrap(); + &document.query_selector("main").unwrap().unwrap() + }, + ); } diff --git a/dyesub-tool/src/render.rs b/dyesub-tool/src/render.rs index 16ffbd7..d8c4bda 100644 --- a/dyesub-tool/src/render.rs +++ b/dyesub-tool/src/render.rs @@ -31,7 +31,10 @@ mod filters { use crate::svg::{SVGMeasure, SVGUnit}; pub fn kle_font_units(kle_font_units: &usize) -> askama::Result { - Ok(SVGMeasure::new((6 + kle_font_units * 2) as f64, SVGUnit::Pixel)) + Ok(SVGMeasure::new( + (6 + kle_font_units * 2) as f64, + SVGUnit::Pixel, + )) } } @@ -45,8 +48,14 @@ pub enum Error { pub type Result = std::result::Result; pub fn render_file(input_path: P, output_path: Q) -> Result<()> -where P: AsRef, Q: AsRef { - use std::{fs::{self, OpenOptions}, io::Write}; +where + P: AsRef, + Q: AsRef, +{ + use std::{ + fs::{self, OpenOptions}, + io::Write, + }; let mut file = OpenOptions::new() .write(true) .truncate(true) @@ -62,4 +71,4 @@ pub fn render(input: &str) -> Result { keyboard: serde_json::from_str(input)?, }; Ok(document.render()?) -} \ No newline at end of file +}