From b3eafe711e1645c256e3d24c03cc3abc8ceb3e0a Mon Sep 17 00:00:00 2001 From: ClementTsang Date: Mon, 17 Feb 2020 17:53:49 -0500 Subject: [PATCH] Fix issue introduced with last commit on searching. --- Cargo.toml | 4 ++-- src/app.rs | 8 ++++---- src/canvas.rs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8490cb56..1df25a23 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,8 +15,8 @@ name = "btm" path = "src/main.rs" [profile.release] -# debug = true -debug = 1 +debug = true +# debug = 1 opt-level = 'z' # Optimize for size. # opt-level = 3 # Optimize for speed. lto = true diff --git a/src/app.rs b/src/app.rs index a5400aea..8df2e1bb 100644 --- a/src/app.rs +++ b/src/app.rs @@ -475,12 +475,12 @@ impl App { let final_regex_string = &format!( "{}{}{}", if self.process_search_state.is_searching_whole_word { - "^{}$" + "^$" } else { "" }, if self.process_search_state.is_ignoring_case { - "(?i){}" + "(?i)" } else { "" }, @@ -492,9 +492,9 @@ impl App { } ); - self.process_search_state.search_state.is_blank_search = false; - + debug!("FINAL: {}", final_regex_string); let new_regex = regex::Regex::new(final_regex_string); + self.process_search_state.search_state.is_blank_search = false; self.process_search_state.search_state.is_invalid_search = new_regex.is_err(); self.process_search_state.search_state.current_regex = Some(new_regex); diff --git a/src/canvas.rs b/src/canvas.rs index 30fc0973..398bbe34 100644 --- a/src/canvas.rs +++ b/src/canvas.rs @@ -231,7 +231,7 @@ impl Painter { ) .split(vertical_dialog_chunk[1]); - if let Some(dd_err) = app_state.dd_err.clone() { + if let Some(dd_err) = &app_state.dd_err { let dd_text = [Text::raw(format!( "\nFailure to properly kill the process - {}", dd_err