1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

Merge pull request #5246 from cakebaker/yes_use_let_else

yes: use let/else to fix todo
This commit is contained in:
Sylvestre Ledru 2023-09-05 09:51:22 +02:00 committed by GitHub
commit 8b24e7ce0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -58,10 +58,7 @@ fn args_into_buffer<'a>(
buf: &mut Vec<u8>,
i: Option<impl Iterator<Item = &'a OsString>>,
) -> Result<(), Box<dyn Error>> {
// TODO: this should be replaced with let/else once available in the MSRV.
let i = if let Some(i) = i {
i
} else {
let Some(i) = i else {
buf.extend_from_slice(b"y\n");
return Ok(());
};