mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
Simplify the code
This commit is contained in:
parent
682664a149
commit
7d7c8eeedb
2 changed files with 2 additions and 2 deletions
|
|
@ -26,7 +26,7 @@ impl Tab {
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut opt = opt.into() as Opt;
|
let mut opt = opt.into() as Opt;
|
||||||
let selected: Vec<_> = self.hovered_and_selected().into_iter().cloned().collect();
|
let selected = self.hovered_and_selected().into_iter().cloned().collect();
|
||||||
|
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
if !opt.confirm || opt.exec.is_empty() {
|
if !opt.confirm || opt.exec.is_empty() {
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ impl Tab {
|
||||||
|
|
||||||
pub fn hovered_and_selected(&self) -> Vec<&Url> {
|
pub fn hovered_and_selected(&self) -> Vec<&Url> {
|
||||||
if let Some(h) = self.current.hovered() {
|
if let Some(h) = self.current.hovered() {
|
||||||
[&h.url].iter().copied().chain(self.selected.iter()).collect()
|
[&h.url].into_iter().chain(self.selected.iter()).collect()
|
||||||
} else {
|
} else {
|
||||||
vec![]
|
vec![]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue