Skip to content
Myr

Rename error_if_any_error to merge_exitcodes

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by fusillicode · committed by David Peter · parent e23398e · Browse files · 3 files+5 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+5 added−5 removed

  • other:+5 added−5 removed

3 files+5 added−5 removed

modified:src/exec/job.rs+2 added-2 removed
5 unmodified lines
6// notice may not be copied, modified, or distributed except7// according to those terms.89use super::CommandTemplate;10use crate::exit_codes::{ExitCode, error_if_any_error};10use crate::exit_codes::{ExitCode, merge_exitcodes};11use crate::walk::WorkerResult;12use std::path::PathBuf;13use std::sync::mpsc::Receiver;14use std::sync::{Arc, Mutex};
30 unmodified lines
45 // Generate a command, execute it and store its exit code.46 results.push(cmd.generate_and_execute(&value, Arc::clone(&out_perm)))47 }48 // Returns error in case of any error.49 error_if_any_error(results)49 merge_exitcodes(results)50}5152pub fn batch(53 rx: Receiver<WorkerResult>,
14 unmodified lines
modified:src/exit_codes.rs+1 added-1 removed
21 unmodified lines
22 }23 }24}2526pub fn error_if_any_error(results: Vec<ExitCode>) -> ExitCode {26pub fn merge_exitcodes(results: Vec<ExitCode>) -> ExitCode {27 if results.iter().any(ExitCode::is_error) {28 return ExitCode::GeneralError;29 }30 ExitCode::Success
1 unmodified line
modified:src/walk.rs+2 added-2 removed
5 unmodified lines
6// notice may not be copied, modified, or distributed except7// according to those terms.89use crate::exec;10use crate::exit_codes::{ExitCode, error_if_any_error};10use crate::exit_codes::{ExitCode, merge_exitcodes};11use crate::fshelper;12use crate::internal::{opts::FdOptions, osstr_to_bytes, MAX_BUFFER_LENGTH};13use crate::output;14
166 unmodified lines
181 for h in handles {182 results.push(h.join().unwrap());183 }184185 error_if_any_error(results)185 merge_exitcodes(results)186 }187 } else {188 let start = time::Instant::now();189
199 unmodified lines