1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-01 05:27: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 => { x => {
let size = match parse_size(x) { let size = parse_size(x)
Some(m) => m, .ok_or_else(|| ProgramOptionsError(format!("invalid mode {}", x)))?;
None => return Err(ProgramOptionsError(format!("invalid mode {}", x))),
};
Ok(BufferType::Size(size)) Ok(BufferType::Size(size))
} }
}, },