mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
36a40987ba
commit
fe679d6f8b
2 changed files with 2 additions and 6 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,10 +33,6 @@ impl<L, R> Either<L, R> {
|
|||
}
|
||||
}
|
||||
|
||||
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<F: FnOnce(&L) -> bool>(&self, f: F) -> bool {
|
||||
self.left().map(f).unwrap_or(false)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue