Clippy fixes for new Rust version (#3392)

This commit is contained in:
JT
2021-05-07 07:58:21 +12:00
committed by GitHub
parent 0f8e31af06
commit 91a929b2a9
19 changed files with 109 additions and 158 deletions

View File

@ -213,15 +213,9 @@ pub fn view_contents(
skip: Option<&Value>,
length: Option<&Value>,
) -> Result<(), Box<dyn std::error::Error>> {
let skip_bytes = match skip {
Some(s) => Some(s.as_usize().unwrap_or(0)),
None => None,
};
let skip_bytes = skip.map(|s| s.as_usize().unwrap_or(0));
let num_bytes = match length {
Some(b) => Some(b.as_usize().unwrap_or(0)),
None => None,
};
let num_bytes = length.map(|b| b.as_usize().unwrap_or(0));
let config = HexConfig {
title: true,