Skip to content

Commit

Permalink
xargs: remove unnecessary else blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
cakebaker committed Feb 21, 2024
1 parent bb562a0 commit e3e20c9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/xargs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,12 +513,12 @@ where
io::ErrorKind::InvalidInput,
format!("Unterminated quote: {q}"),
));
} else if i == 0 {
}
if i == 0 {
return Ok(None);
} else {
pending.clear();
break;
}
pending.clear();
break;
}

pending.resize(bytes_read, 0);
Expand Down Expand Up @@ -603,9 +603,8 @@ where
arg: String::from_utf8_lossy(bytes).into_owned().into(),
kind: ArgumentKind::HardTerminated,
});
} else {
break None;
}
break None;
})
}
}
Expand Down Expand Up @@ -671,7 +670,8 @@ fn process_input(
&& (options.max_args.is_some() || options.max_lines.is_some())
{
return Err(XargsError::ArgumentTooLarge);
} else if have_pending_command {
}
if have_pending_command {
result.combine(current_builder.execute()?);
}

Expand Down

0 comments on commit e3e20c9

Please sign in to comment.