Skip to content

Commit

Permalink
Fix typo and run cargo fmt
Browse files Browse the repository at this point in the history
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
  • Loading branch information
NobodyXu committed Apr 18, 2024
1 parent 22174dd commit 17453d9
Showing 1 changed file with 27 additions and 29 deletions.
56 changes: 27 additions & 29 deletions src/lib.rs
Expand Up @@ -1496,37 +1496,35 @@ impl Build {

cell_update(&pendings, |mut pendings| {
// Try waiting on them.
pending.retain_mut(
|(cmd, program, child, _token)| {
match try_wait_on_child(
cmd,
program,
&mut child.0,
&mut stdout,
&mut child.1,
) {
Ok(Some(())) => {
// Task done, remove the entry
has_made_progress.set(true);
false
}
Ok(None) => true, // Task still not finished, keep the entry
Err(err) => {
// Task fail, remove the entry.
// Since we can only return one error, log the error to make
// sure users always see all the compilation failures.
has_made_progress.set(true);

if self.cargo_output.warnings {
let _ = writeln!(stdout, "cargo:warning={}", err);
}
error = Some(err);

false
pendings.retain_mut(|(cmd, program, child, _token)| {
match try_wait_on_child(
cmd,
program,
&mut child.0,
&mut stdout,
&mut child.1,
) {
Ok(Some(())) => {
// Task done, remove the entry
has_made_progress.set(true);
false
}
Ok(None) => true, // Task still not finished, keep the entry
Err(err) => {
// Task fail, remove the entry.
// Since we can only return one error, log the error to make
// sure users always see all the compilation failures.
has_made_progress.set(true);

if self.cargo_output.warnings {
let _ = writeln!(stdout, "cargo:warning={}", err);
}
error = Some(err);

false
}
},
);
}
});
pendings_is_empty = pendings.is_empty();
pendings
});
Expand Down

0 comments on commit 17453d9

Please sign in to comment.