Apply clippy suggestions

This commit is contained in:
merkrafter authored and David Peter committed 2021-11-14 09:26:21 +01:00
1 parent 1b33e516d9
commit 7a225fe732
2 files changed
+7 -8

No files matched your search

+3 -4
View File
@@ -245,8 +245,7 @@ fn run() -> Result<(), AnyhowError> {
)) ))
}) })
.transpose()? .transpose()?
.unwrap_or(0) .unwrap_or(0);
.into();
let stdout = io::stdout(); let stdout = io::stdout();
let mut stdout_lock = stdout.lock(); let mut stdout_lock = stdout.lock();
@@ -276,7 +275,7 @@ fn main() {
clap::ErrorKind::VersionDisplayed => { clap::ErrorKind::VersionDisplayed => {
// Version output in clap 2.33.1 (dep as of now) doesn't have a newline // Version output in clap 2.33.1 (dep as of now) doesn't have a newline
// and the fix is not included even in the latest stable release // and the fix is not included even in the latest stable release
println!(""); println!();
std::process::exit(0) std::process::exit(0)
} }
_ => (), _ => (),
@@ -457,7 +456,7 @@ fn parse_byte_offset(n: &str, block_size: PositiveI64) -> Result<ByteOffset, Byt
} }
num.checked_mul(unit.get_multiplier()) num.checked_mul(unit.get_multiplier())
.ok_or_else(|| UnitMultiplicationOverflow) .ok_or(UnitMultiplicationOverflow)
.and_then(into_byte_offset) .and_then(into_byte_offset)
} }
+4 -4
View File
@@ -80,10 +80,10 @@ impl Squeezer {
pub fn active(&self) -> bool { pub fn active(&self) -> bool {
use self::SqueezeState::*; use self::SqueezeState::*;
match self.state { matches!(
Squeeze | SqueezeActive | SqueezeFirstLine | SqueezeActiveFirstLine => true, self.state,
_ => false, Squeeze | SqueezeActive | SqueezeFirstLine | SqueezeActiveFirstLine
} )
} }
pub fn action(&self) -> SqueezeAction { pub fn action(&self) -> SqueezeAction {