From afe9dab09237f614ead06ef2c879a671e341616b Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Fri, 7 Jul 2023 00:31:45 +0200 Subject: remove dead code --- src/gui/easing.rs | 31 ------------------------------- src/gui/mod.rs | 3 +-- src/index.rs | 17 ++++++++--------- 3 files changed, 9 insertions(+), 42 deletions(-) diff --git a/src/gui/easing.rs b/src/gui/easing.rs index 665b332..a4ef652 100644 --- a/src/gui/easing.rs +++ b/src/gui/easing.rs @@ -4,43 +4,12 @@ use lyon_algorithms::measure::PathMeasurements; use lyon_algorithms::path::{builder::NoAttributes, path::BuilderImpl, Path}; use once_cell::sync::Lazy; -pub static EMPHASIZED: Lazy = Lazy::new(|| { - Easing::builder() - .cubic_bezier_to([0.05, 0.0], [0.133333, 0.06], [0.166666, 0.4]) - .cubic_bezier_to([0.208333, 0.82], [0.25, 1.0], [1.0, 1.0]) - .build() -}); - -pub static EMPHASIZED_DECELERATE: Lazy = Lazy::new(|| { - Easing::builder() - .cubic_bezier_to([0.05, 0.7], [0.1, 1.0], [1.0, 1.0]) - .build() -}); - -pub static EMPHASIZED_ACCELERATE: Lazy = Lazy::new(|| { - Easing::builder() - .cubic_bezier_to([0.3, 0.0], [0.8, 0.15], [1.0, 1.0]) - .build() -}); - pub static STANDARD: Lazy = Lazy::new(|| { Easing::builder() .cubic_bezier_to([0.2, 0.0], [0.0, 1.0], [1.0, 1.0]) .build() }); -pub static STANDARD_DECELERATE: Lazy = Lazy::new(|| { - Easing::builder() - .cubic_bezier_to([0.0, 0.0], [0.0, 1.0], [1.0, 1.0]) - .build() -}); - -pub static STANDARD_ACCELERATE: Lazy = Lazy::new(|| { - Easing::builder() - .cubic_bezier_to([0.3, 0.0], [1.0, 1.0], [1.0, 1.0]) - .build() -}); - pub struct Easing { path: Path, measurements: PathMeasurements, diff --git a/src/gui/mod.rs b/src/gui/mod.rs index 0c1b9cc..a32ceff 100644 --- a/src/gui/mod.rs +++ b/src/gui/mod.rs @@ -103,7 +103,6 @@ async fn generate() -> Index { Index::generate(input, file, |counter, nof| { let p = ((counter * 100) / nof) as u8; *GENERATE_PROGRESS.lock().unwrap() = p; - eprint!("\r\x1b[2K{} of {} files indexed ({}%)", counter, nof, p); std::io::stdout().flush().ok(); }) } @@ -198,7 +197,7 @@ impl Application for App { ) } Message::SearchFinished(results) => { - state.results = results.clone(); + state.results = results; Command::none() } _ => { diff --git a/src/index.rs b/src/index.rs index 9f0af1d..d90f403 100644 --- a/src/index.rs +++ b/src/index.rs @@ -1,4 +1,3 @@ -use std::fmt::{Formatter, Debug, Result}; use std::fs::File; use std::io::{Write, BufReader, BufRead}; use walkdir::*; @@ -79,14 +78,14 @@ impl Index { }); - match nof_handle { - Some(t) => { - nof = t.join().unwrap(); - nof_handle = None; - } - None => { - callback(counter, nof); - } + } + match nof_handle { + Some(t) => { + nof = t.join().unwrap(); + nof_handle = None; + } + None => { + callback(counter, nof); } } } -- cgit v1.2.3-70-g09d2