diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-11-02 12:19:21 -0500 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-11-02 12:19:21 -0500 |
commit | 0cb2c16b4661762efbe3f8263ebb7837657cfb92 (patch) | |
tree | cfd70ab8c58d4d154dd8b152ac607c42a5f92eff /src/util | |
parent | 9b6aea79036c40885f352d26e8a2a4892da15306 (diff) |
stop using debug print for termion key
- fix certain commands not showing options
- fix typos
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/sort.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/util/sort.rs b/src/util/sort.rs index d58c946..b4e916e 100644 --- a/src/util/sort.rs +++ b/src/util/sort.rs @@ -24,7 +24,7 @@ impl SortType { _ => None, } } - pub fn as_str(&self) -> &str { + pub const fn as_str(&self) -> &str { match *self { SortType::Lexical => "lexical", SortType::Mtime => "mtime", @@ -34,6 +34,12 @@ impl SortType { } } +impl std::fmt::Display for SortType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + write!(f, "{}", self.as_str()) + } +} + #[derive(Clone, Debug)] pub struct SortOption { pub show_icons: bool, |