logo

Rust program to generate site logo

git clone git://git.shimmy1996.com/logo.git
commit 5886ca1b85689195cebb889ee43094616a181e8a
parent c466daffa6fedf40fb1f3f657eb132498a654b30
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date:   Tue, 29 Jan 2019 10:03:38 -0500

Remove redoundant type annotations.

Diffstat:
Msrc/main.rs | 11++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/main.rs b/src/main.rs
@@ -23,6 +23,7 @@ fn main() -> io::Result<()> {
     // Color Pallette
     let primary_color = "#700000";
     let secondary_color = "#707070";
+
     // Output Path
     let svg_path = "logo.svg";
     let png_path = "logo.png";
@@ -38,10 +39,10 @@ fn main() -> io::Result<()> {
     let height = input.trim().parse::<i32>().unwrap();
 
     // Draw logo and save svg.
-    let unit: f64 = (cmp::min(width, height) as f64) / 10.;
-    let center: (f64, f64) = ((width as f64) / 2., (height as f64) / 2.);
-    let top_touch: f64 = center.0 + 2. / 3. * center.1 - 2. * unit;
-    let right_touch: f64 = center.1 + 2. * unit - 2. / 3. * center.0;
+    let unit = (cmp::min(width, height) as f64) / 10.;
+    let center = ((width as f64) / 2., (height as f64) / 2.);
+    let top_touch = center.0 + 2. / 3. * center.1 - 2. * unit;
+    let right_touch = center.1 + 2. * unit - 2. / 3. * center.0;
 
     let flare_points: Vec<(f64, f64)> = vec![
         (center.0 - 3. * unit, center.1),
@@ -91,7 +92,7 @@ fn main() -> io::Result<()> {
     svg::save(svg_path, &document).unwrap();
 
     // Convert to png.
-    let _resvg = resvg::init();
+    resvg::init();
     let mut opt = resvg::Options::default();
     opt.usvg.path = Some(svg_path.clone().into());
     let rtree = usvg::Tree::from_file(svg_path, &opt.usvg).unwrap();