mirror of
https://github.com/sharkdp/bat.git
synced 2025-04-14 06:40:39 +01:00
Use new matches!(…) macro to simplify code
This commit is contained in:
parent
09fbabb0b8
commit
03a2710a08
@ -137,11 +137,7 @@ impl<'a> Input<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_stdin(&self) -> bool {
|
pub fn is_stdin(&self) -> bool {
|
||||||
if let InputKind::StdIn = self.kind {
|
matches!(self.kind, InputKind::StdIn)
|
||||||
true
|
|
||||||
} else {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn with_name(mut self, provided_name: Option<&OsStr>) -> Self {
|
pub fn with_name(mut self, provided_name: Option<&OsStr>) -> Self {
|
||||||
|
@ -150,11 +150,7 @@ impl OutputType {
|
|||||||
|
|
||||||
#[cfg(feature = "paging")]
|
#[cfg(feature = "paging")]
|
||||||
pub(crate) fn is_pager(&self) -> bool {
|
pub(crate) fn is_pager(&self) -> bool {
|
||||||
if let OutputType::Pager(_) = self {
|
matches!(self, OutputType::Pager(_))
|
||||||
true
|
|
||||||
} else {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(feature = "paging"))]
|
#[cfg(not(feature = "paging"))]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user