diff --git a/dyesub-tool/src/main.rs b/dyesub-tool/src/main.rs index dd455cd..0a4c50d 100644 --- a/dyesub-tool/src/main.rs +++ b/dyesub-tool/src/main.rs @@ -1,9 +1,9 @@ pub mod svg; use svg::*; -use std::{fs::OpenOptions, io::Write}; use askama::Template; use derive_more::From; +use std::{fs::OpenOptions, io::Write}; #[derive(Template)] #[template(path = "document.xml")] @@ -25,8 +25,8 @@ fn main() -> Result<(), Error> { .create(true) .open("output.svg")?; let document = DocumentTemplate { - width: SVGMeasure::new(8.5, SVGUnit::Inch), - height: SVGMeasure::new(11.0,SVGUnit::Inch), + width: SVGMeasure::new(8.5, SVGUnit::Inch), + height: SVGMeasure::new(11.0, SVGUnit::Inch), }; write!(file, "{}", document.render()?)?; Ok(()) diff --git a/dyesub-tool/src/svg/measure.rs b/dyesub-tool/src/svg/measure.rs index 6750efc..1fb1398 100644 --- a/dyesub-tool/src/svg/measure.rs +++ b/dyesub-tool/src/svg/measure.rs @@ -1,6 +1,9 @@ use super::SVGUnit; use std::fmt; -use std::{ops::{Add, Sub, Mul, Div}, fmt::Display}; +use std::{ + fmt::Display, + ops::{Add, Div, Mul, Sub}, +}; pub struct SVGMeasure { pub measure: f64, @@ -49,4 +52,4 @@ impl Div for SVGMeasure { fn div(self, scalar: f64) -> SVGMeasure { SVGMeasure::new(self.measure / scalar, self.unit) } -} \ No newline at end of file +} diff --git a/dyesub-tool/src/svg/mod.rs b/dyesub-tool/src/svg/mod.rs index 3c500f1..2c4d0fd 100644 --- a/dyesub-tool/src/svg/mod.rs +++ b/dyesub-tool/src/svg/mod.rs @@ -2,4 +2,4 @@ mod unit; pub use unit::SVGUnit; mod measure; -pub use measure::SVGMeasure; \ No newline at end of file +pub use measure::SVGMeasure; diff --git a/dyesub-tool/src/svg/unit.rs b/dyesub-tool/src/svg/unit.rs index 6c4ef9a..da85208 100644 --- a/dyesub-tool/src/svg/unit.rs +++ b/dyesub-tool/src/svg/unit.rs @@ -35,21 +35,25 @@ pub enum SVGUnit { impl Display for SVGUnit { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { use SVGUnit::*; - write!(f, "{}", match &self { - Pixel => "px", - Inch => "in", - Centimeter => "cm", - Millimeter => "mm", - Point => "pt", - Pica => "pc", - Em => "em", - Ex => "ex", - Character => "ch", - Rem => "rem", - ViewportWidth => "vw", - ViewportHeight => "vh", - ViewportMinimum => "vmin", - ViewportMaximum => "vmax", - }) + write!( + f, + "{}", + match &self { + Pixel => "px", + Inch => "in", + Centimeter => "cm", + Millimeter => "mm", + Point => "pt", + Pica => "pc", + Em => "em", + Ex => "ex", + Character => "ch", + Rem => "rem", + ViewportWidth => "vw", + ViewportHeight => "vh", + ViewportMinimum => "vmin", + ViewportMaximum => "vmax", + } + ) } -} \ No newline at end of file +}