mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
chore: fix clippy
This commit is contained in:
parent
fd81366de8
commit
4093000b21
2 changed files with 11 additions and 19 deletions
|
|
@ -212,14 +212,9 @@ impl Input {
|
|||
self.completion.close();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
match key {
|
||||
Key { code: KeyCode::Tab, shift: false, ctrl: false, alt: false } => {
|
||||
} else if matches!(key, Key { code: KeyCode::Tab, shift: false, ctrl: false, alt: false }) {
|
||||
return self.complete();
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(c) = key.plain() {
|
||||
return self.type_char(c);
|
||||
|
|
|
|||
|
|
@ -74,24 +74,21 @@ impl Tab {
|
|||
.map(|list| {
|
||||
list
|
||||
.filter_map(|file| {
|
||||
file
|
||||
.ok()
|
||||
.map(|f| {
|
||||
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) {
|
||||
if f.metadata().is_ok_and(|m| m.is_dir()) && name.starts_with(cmp_prefix) {
|
||||
Some(name)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
.flatten()
|
||||
})
|
||||
.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}/")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue