mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-11-26 22:06:26 +00:00
Use more accurate time to fix inconsistent sorting
This commit is contained in:
parent
485611e7c9
commit
649744dc82
@ -167,7 +167,7 @@ pub struct DeviceIDs {
|
|||||||
|
|
||||||
|
|
||||||
/// One of a file’s timestamps (created, accessed, or modified).
|
/// One of a file’s timestamps (created, accessed, or modified).
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
pub struct Time {
|
pub struct Time {
|
||||||
pub seconds: time_t,
|
pub seconds: time_t,
|
||||||
pub nanoseconds: time_t,
|
pub nanoseconds: time_t,
|
||||||
|
@ -245,10 +245,10 @@ impl SortField {
|
|||||||
|
|
||||||
SortField::Size => a.metadata.len().cmp(&b.metadata.len()),
|
SortField::Size => a.metadata.len().cmp(&b.metadata.len()),
|
||||||
SortField::FileInode => a.metadata.ino().cmp(&b.metadata.ino()),
|
SortField::FileInode => a.metadata.ino().cmp(&b.metadata.ino()),
|
||||||
SortField::ModifiedDate => a.metadata.mtime().cmp(&b.metadata.mtime()),
|
SortField::ModifiedDate => a.modified_time().cmp(&b.modified_time()),
|
||||||
SortField::AccessedDate => a.metadata.atime().cmp(&b.metadata.atime()),
|
SortField::AccessedDate => a.accessed_time().cmp(&b.accessed_time()),
|
||||||
SortField::CreatedDate => a.metadata.ctime().cmp(&b.metadata.ctime()),
|
SortField::CreatedDate => a.created_time().cmp(&b.created_time()),
|
||||||
SortField::ModifiedAge => b.metadata.mtime().cmp(&a.metadata.mtime()), // flip b and a
|
SortField::ModifiedAge => b.modified_time().cmp(&a.modified_time()), // flip b and a
|
||||||
|
|
||||||
SortField::FileType => match a.type_char().cmp(&b.type_char()) { // todo: this recomputes
|
SortField::FileType => match a.type_char().cmp(&b.type_char()) { // todo: this recomputes
|
||||||
Ordering::Equal => natord::compare(&*a.name, &*b.name),
|
Ordering::Equal => natord::compare(&*a.name, &*b.name),
|
||||||
|
Loading…
Reference in New Issue
Block a user