mirror of
https://github.com/denisidoro/navi.git
synced 2026-01-23 02:14:19 +00:00
fix: Fixes for clippy suggestions
This commit is contained in:
parent
77151bd1c1
commit
aa2bc4e9aa
2 changed files with 3 additions and 5 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue