Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuichiueda committed Dec 19, 2023
1 parent 6c42867 commit e9f39f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/elements/command/if.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl IfCommand {

pub fn parse(feeder: &mut Feeder, core: &mut ShellCore) -> Option<IfCommand> {
let mut ans = Self::new();
let mut if_script = Some(Script::new());
let mut if_script = None;
if command::eat_inner_script(feeder, core, "if", vec!["then"], &mut if_script) {
ans.text.push_str("if");
ans.text.push_str(&if_script.as_mut().unwrap().get_text());
Expand All @@ -62,7 +62,7 @@ impl IfCommand {
return None;
}

let mut then_script = Some(Script::new());
let mut then_script = None;
if command::eat_inner_script(feeder, core, "then", vec!["fi"], &mut then_script) {
ans.text.push_str("then");
ans.text.push_str(&then_script.as_mut().unwrap().get_text());
Expand Down

0 comments on commit e9f39f2

Please sign in to comment.