1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-31 04:57:45 +00:00

stdbuf: clean up returning Err

This commit is contained in:
Jeong YunWon 2021-06-11 14:25:40 +09:00
parent 9c56a40bcb
commit b59c1dae59

View file

@ -152,10 +152,8 @@ fn check_option(matches: &ArgMatches, name: &str) -> Result<BufferType, ProgramO
}
}
x => {
let size = match parse_size(x) {
Some(m) => m,
None => return Err(ProgramOptionsError(format!("invalid mode {}", x))),
};
let size = parse_size(x)
.ok_or_else(|| ProgramOptionsError(format!("invalid mode {}", x)))?;
Ok(BufferType::Size(size))
}
},