diff options
author | Sebastian Thiel <sebastian.thiel@icloud.com> | 2020-07-07 08:23:23 +0800 |
---|---|---|
committer | Sebastian Thiel <sebastian.thiel@icloud.com> | 2020-07-07 08:23:23 +0800 |
commit | 82d005b9e3ed9ce8d4441c607ec160f2f0a48b1c (patch) | |
tree | 8e8266faa454065f15c11871a745af96f64b9ce9 /src/common.rs | |
parent | 2c73b4d59603c12d31ded1a2f2ca9ef97a5ff0b3 (diff) |
Fix color handling (causing the text to disappear); fix tty detection
Crossterm works differently from termion, I might say: more correct!
Diffstat (limited to 'src/common.rs')
-rw-r--r-- | src/common.rs | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/common.rs b/src/common.rs index d297c45..eb1bb03 100644 --- a/src/common.rs +++ b/src/common.rs @@ -112,38 +112,6 @@ pub enum TraversalSorting { AlphabeticalByFileName, } -/// Specify the kind of color to use -#[derive(Clone, Copy)] -pub enum Color { - /// Use no color - None, - /// Use terminal colors - Terminal, -} - -pub(crate) struct DisplayColor<C> { - kind: Color, - color: C, -} - -impl Color { - pub(crate) fn display<C>(self, color: C) -> DisplayColor<C> { - DisplayColor { kind: self, color } - } -} - -impl<C> fmt::Display for DisplayColor<C> -where - C: fmt::Display, -{ - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { - match self.kind { - Color::None => Ok(()), - Color::Terminal => self.color.fmt(f), - } - } -} - /// Configures a filesystem walk, including output and formatting options. #[derive(Clone)] pub struct WalkOptions { @@ -153,7 +121,6 @@ pub struct WalkOptions { pub byte_format: ByteFormat, pub count_hard_links: bool, pub apparent_size: bool, - pub color: Color, pub sorting: TraversalSorting, pub cross_filesystems: bool, } |