1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-04 15:07:47 +00:00

refactor/polish ~ fix cargo clippy complaints (if is_none => as_ref()?)

This commit is contained in:
Roy Ivy III 2019-12-27 15:04:25 -06:00
parent 88db11a328
commit 1642933275

View file

@ -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<String>) -> Option<u64> {
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