mirror of
https://github.com/sharkdp/hexyl.git
synced 2026-10-26 20:16:31 +00:00
Apply clippy suggestions
This commit is contained in:
1 parent
1b33e516d9
commit
7a225fe732
2 files changed
+7
-8
No files matched your search
+3
-4
@@ -245,8 +245,7 @@ fn run() -> Result<(), AnyhowError> {
|
||||
))
|
||||
})
|
||||
.transpose()?
|
||||
.unwrap_or(0)
|
||||
.into();
|
||||
.unwrap_or(0);
|
||||
|
||||
let stdout = io::stdout();
|
||||
let mut stdout_lock = stdout.lock();
|
||||
@@ -276,7 +275,7 @@ fn main() {
|
||||
clap::ErrorKind::VersionDisplayed => {
|
||||
// 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
|
||||
println!("");
|
||||
println!();
|
||||
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())
|
||||
.ok_or_else(|| UnitMultiplicationOverflow)
|
||||
.ok_or(UnitMultiplicationOverflow)
|
||||
.and_then(into_byte_offset)
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -80,10 +80,10 @@ impl Squeezer {
|
||||
|
||||
pub fn active(&self) -> bool {
|
||||
use self::SqueezeState::*;
|
||||
match self.state {
|
||||
Squeeze | SqueezeActive | SqueezeFirstLine | SqueezeActiveFirstLine => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(
|
||||
self.state,
|
||||
Squeeze | SqueezeActive | SqueezeFirstLine | SqueezeActiveFirstLine
|
||||
)
|
||||
}
|
||||
|
||||
pub fn action(&self) -> SqueezeAction {
|
||||
|
||||
Reference in new issue
Block a user