mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
67fcb484fb
commit
9ec0f830f6
2 changed files with 2 additions and 4 deletions
|
|
@ -4,7 +4,7 @@ use anyhow::Result;
|
||||||
use tokio::fs;
|
use tokio::fs;
|
||||||
use yazi_shared::{Cha, ChaMeta, Url};
|
use yazi_shared::{Cha, ChaMeta, Url};
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug, Default)]
|
||||||
pub struct File {
|
pub struct File {
|
||||||
pub url: Url,
|
pub url: Url,
|
||||||
pub cha: Cha,
|
pub cha: Cha,
|
||||||
|
|
|
||||||
|
|
@ -72,11 +72,9 @@ impl FilesSorter {
|
||||||
if self.reverse { ordering.reverse() } else { ordering }
|
if self.reverse { ordering.reverse() } else { ordering }
|
||||||
});
|
});
|
||||||
|
|
||||||
let dummy = File { url: Default::default(), cha: Default::default(), link_to: None };
|
|
||||||
|
|
||||||
let mut new = Vec::with_capacity(indices.len());
|
let mut new = Vec::with_capacity(indices.len());
|
||||||
for i in indices {
|
for i in indices {
|
||||||
new.push(mem::replace(&mut items[i], dummy.clone()));
|
new.push(mem::take(&mut items[i]));
|
||||||
}
|
}
|
||||||
*items = new;
|
*items = new;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue