From caba881a95df224a453c8c01734da4f763039732 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Sat, 25 Mar 2023 12:07:20 -0400 Subject: [PATCH] clippy --- src/function_manager.rs | 9 +++------ src/misc.rs | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/function_manager.rs b/src/function_manager.rs index 1b027db..6a3be9c 100644 --- a/src/function_manager.rs +++ b/src/function_manager.rs @@ -105,13 +105,10 @@ impl FunctionManager { .hint_forward(true) // Make the hint appear after the last text in the textbox .lock_focus(true) .id(te_id) // Set widget's id to `te_id` - .hint_text({ + .hint_text( // If there's a single hint, go ahead and apply the hint here, if not, set the hint to an empty string - match function.autocomplete.hint.single() { - Some(single_hint) => single_hint, - None => "", - } - }), + function.autocomplete.hint.single().unwrap_or(""), + ), ); // Only keep valid chars diff --git a/src/misc.rs b/src/misc.rs index 9eb3954..cb2cc36 100644 --- a/src/misc.rs +++ b/src/misc.rs @@ -129,7 +129,7 @@ pub fn newtons_method( /// Inputs `Vec>` and outputs a `String` containing a pretty representation of the Vector pub fn option_vec_printer(data: &[Option]) -> String { let formatted: String = data - .into_iter() + .iter() .map(|item| match item { Some(x) => x.to_string(), None => "None".to_owned(),