chore: fix clippy

This commit is contained in:
XOR-op 2023-10-26 23:41:30 -04:00
parent fd81366de8
commit 4093000b21
2 changed files with 11 additions and 19 deletions

View file

@ -212,13 +212,8 @@ impl Input {
self.completion.close();
}
}
} else {
match key {
Key { code: KeyCode::Tab, shift: false, ctrl: false, alt: false } => {
return self.complete();
}
_ => (),
}
} else if matches!(key, Key { code: KeyCode::Tab, shift: false, ctrl: false, alt: false }) {
return self.complete();
}
if let Some(c) = key.plain() {

View file

@ -74,24 +74,21 @@ impl Tab {
.map(|list| {
list
.filter_map(|file| {
file
.ok()
.map(|f| {
let name = f.file_name().to_string_lossy().to_string();
if f.metadata().is_ok_and(|m| m.is_dir()) && name.starts_with(&cmp_prefix) {
Some(name)
} else {
None
}
})
.flatten()
file.ok().and_then(|f| {
let name = f.file_name().to_string_lossy().to_string();
if f.metadata().is_ok_and(|m| m.is_dir()) && name.starts_with(cmp_prefix) {
Some(name)
} else {
None
}
})
})
.collect()
})
.unwrap_or_default()
},
|current, new| {
if let Some((prefix, _)) = current.rsplit_once("/") {
if let Some((prefix, _)) = current.rsplit_once('/') {
format!("{prefix}/{new}/")
} else {
format!("{new}/")