Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuichiueda committed Jan 10, 2024
1 parent f84ab09 commit 2aa9023
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/elements/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub fn eat_inner_script(feeder: &mut Feeder, core: &mut ShellCore,
! ans.is_none()
}

pub fn eat_redirect(feeder: &mut Feeder, core: &mut ShellCore,
fn eat_redirect(feeder: &mut Feeder, core: &mut ShellCore,
ans: &mut Vec<Redirect>, ans_text: &mut String) -> bool {
if let Some(r) = Redirect::parse(feeder, core) {
*ans_text += &r.text.clone();
Expand Down
5 changes: 2 additions & 3 deletions src/elements/command/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,8 @@ impl SimpleCommand {
feeder.set_backup();

loop {
command::eat_blank_with_comment(feeder, core, &mut ans.text);
if ! command::eat_redirect(feeder, core, &mut ans.redirects, &mut ans.text)
&& ! Self::eat_word(feeder, &mut ans, core) {
command::eat_redirects(feeder, core, &mut ans.redirects, &mut ans.text);
if ! Self::eat_word(feeder, &mut ans, core) {
break;
}
}
Expand Down

0 comments on commit 2aa9023

Please sign in to comment.