mirror of
https://github.com/sharkdp/hexyl.git
synced 2026-10-30 09:05:54 +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()?
|
.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
@@ -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 {
|
||||||
|
|||||||
Reference in new issue
Block a user