fix: Fixes for clippy suggestions

This commit is contained in:
Aleksey @soar Smyrnov 2025-04-23 19:57:45 -06:00 committed by Aleksey Smyrnov
parent 77151bd1c1
commit aa2bc4e9aa
No known key found for this signature in database
2 changed files with 3 additions and 5 deletions

View file

@ -154,10 +154,8 @@ fn prompt_finder(
})
.context("finder was unable to prompt with suggestions")?;
if suggestion.is_none() {
if !variable_history.contains(&output) {
filesystem::save_variable_history(variable_name, &output);
}
if suggestion.is_none() && !variable_history.contains(&output) {
filesystem::save_variable_history(variable_name, &output);
}
Ok(output)

View file

@ -111,7 +111,7 @@ pub fn get_variable_history(variable: &str) -> Vec<String> {
reader
.lines()
.filter_map(|line| line.ok())
.map_while(|line| line.ok())
.filter_map(|line| {
let parts: Vec<&str> = line.splitn(2, ':').collect();
if parts.len() == 2 && parts[0] == variable {