Skip to content

Commit

Permalink
fn success_or_exitstatus
Browse files Browse the repository at this point in the history
  • Loading branch information
Urhengulas committed Apr 1, 2021
1 parent e13937a commit 8e91dbf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,7 @@ fn link_normally(args: &[String]) -> Result<(), i32> {
c.args(args);
log::trace!("{:?}", c);

let status = c.status().unwrap();
if !status.success() {
return Err(status.code().unwrap_or(EXIT_CODE_FAILURE));
}
Ok(())
success_or_exitstatus(c)
}

fn link_again(
Expand All @@ -130,6 +126,10 @@ fn link_again(
.current_dir(tempdir.path());
log::trace!("{:?}", c);

success_or_exitstatus(c)
}

fn success_or_exitstatus(mut c: Command) -> Result<(), i32> {
let status = c.status().unwrap();
if !status.success() {
return Err(status.code().unwrap_or(EXIT_CODE_FAILURE));
Expand Down

0 comments on commit 8e91dbf

Please sign in to comment.