From 1642933275826f43a2984291005b91e5a5e5248e Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Fri, 27 Dec 2019 15:04:25 -0600 Subject: [PATCH] refactor/polish ~ fix `cargo clippy` complaints (if is_none => as_ref()?) --- src/shred/shred.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/shred/shred.rs b/src/shred/shred.rs index b12885045..e28874b0b 100644 --- a/src/shred/shred.rs +++ b/src/shred/shred.rs @@ -338,9 +338,7 @@ fn show_help(opts: &getopts::Options) { // TODO: Add support for all postfixes here up to and including EiB // http://www.gnu.org/software/coreutils/manual/coreutils.html#Block-size fn get_size(size_str_opt: Option) -> Option { - if size_str_opt.is_none() { - return None; - } + size_str_opt.as_ref()?; let mut size_str = size_str_opt.as_ref().unwrap().clone(); // Immutably look at last character of size string