Use new matches!(…) macro to simplify code

This commit is contained in:
sharkdp authored and David Peter committed 2021-01-09 19:43:39 +01:00
1 parent 09fbabb0b8
commit 03a2710a08
2 files changed
+2 -10

No files matched your search

+1 -5
View File
@@ -137,11 +137,7 @@ impl<'a> Input<'a> {
}
pub fn is_stdin(&self) -> bool {
if let InputKind::StdIn = self.kind {
true
} else {
false
}
matches!(self.kind, InputKind::StdIn)
}
pub fn with_name(mut self, provided_name: Option<&OsStr>) -> Self {
+1 -5
View File
@@ -150,11 +150,7 @@ impl OutputType {
#[cfg(feature = "paging")]
pub(crate) fn is_pager(&self) -> bool {
if let OutputType::Pager(_) = self {
true
} else {
false
}
matches!(self, OutputType::Pager(_))
}
#[cfg(not(feature = "paging"))]