yes: use let/else to fix todo

This commit is contained in:
Daniel Hofstetter 2023-09-05 08:16:25 +02:00
parent 8a2bf34508
commit e493b9c527

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(());
};