From 3420dea6e3d36d950b46ce5a9bd32342be580033 Mon Sep 17 00:00:00 2001 From: fengxiaojun Date: Fri, 12 Jan 2024 16:47:58 +0800 Subject: [PATCH] code optimize --- src/interactive/widgets/footer.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/interactive/widgets/footer.rs b/src/interactive/widgets/footer.rs index a91fdb6e..1c571857 100644 --- a/src/interactive/widgets/footer.rs +++ b/src/interactive/widgets/footer.rs @@ -25,6 +25,7 @@ pub struct FooterProps { impl Footer { pub fn render(&self, props: impl Borrow, area: Rect, buf: &mut Buffer) { + use SortMode::*; let FooterProps { total_bytes, entries_traversed, @@ -39,12 +40,12 @@ impl Footer { Span::from(format!( "Sort mode: {} Total disk usage: {} Items: {} {progress} ", match sort_mode { - SortMode::SizeAscending => "size ascending", - SortMode::SizeDescending => "size descending", - SortMode::MTimeAscending => "modified ascending", - SortMode::MTimeDescending => "modified descending", - SortMode::CountAscending => "items ascending", - SortMode::CountDescending => "items descending", + SizeAscending => "size ascending", + SizeDescending => "size descending", + MTimeAscending => "modified ascending", + MTimeDescending => "modified descending", + CountAscending => "items ascending", + CountDescending => "items descending", }, match total_bytes { Some(b) => format!("{}", format.display(*b)),