diff --git a/yazi-adapter/src/adapter.rs b/yazi-adapter/src/adapter.rs index 01e858d2..3bce7cff 100644 --- a/yazi-adapter/src/adapter.rs +++ b/yazi-adapter/src/adapter.rs @@ -81,9 +81,9 @@ impl Adapter { impl Adapter { pub fn matches(emulator: Emulator) -> Self { - if matches!(emulator.kind.left(), Some(Brand::Microsoft)) { + if emulator.kind.is_left_and(|&b| b == Brand::Microsoft) { return Self::Sixel; - } else if WSL.get() && matches!(emulator.kind.left(), Some(Brand::WezTerm)) { + } else if WSL.get() && emulator.kind.is_left_and(|&b| b == Brand::WezTerm) { return Self::KgpOld; } diff --git a/yazi-shared/src/either.rs b/yazi-shared/src/either.rs index 76d57bb5..dfa6e6e9 100644 --- a/yazi-shared/src/either.rs +++ b/yazi-shared/src/either.rs @@ -33,10 +33,6 @@ impl Either { } } - pub fn is_left(&self) -> bool { matches!(self, Either::Left(_)) } - - pub fn is_right(&self) -> bool { matches!(self, Either::Right(_)) } - pub fn is_left_and bool>(&self, f: F) -> bool { self.left().map(f).unwrap_or(false) }