mirror of
https://github.com/sharkdp/fd.git
synced 2024-09-29 21:41:30 +02:00
Rename error_if_any_error to merge_exitcodes
This commit is contained in:
parent
e23398e6d0
commit
232e3937f2
@ -7,7 +7,7 @@
|
|||||||
// according to those terms.
|
// according to those terms.
|
||||||
|
|
||||||
use super::CommandTemplate;
|
use super::CommandTemplate;
|
||||||
use crate::exit_codes::{ExitCode, error_if_any_error};
|
use crate::exit_codes::{ExitCode, merge_exitcodes};
|
||||||
use crate::walk::WorkerResult;
|
use crate::walk::WorkerResult;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::sync::mpsc::Receiver;
|
use std::sync::mpsc::Receiver;
|
||||||
@ -46,7 +46,7 @@ pub fn job(
|
|||||||
results.push(cmd.generate_and_execute(&value, Arc::clone(&out_perm)))
|
results.push(cmd.generate_and_execute(&value, Arc::clone(&out_perm)))
|
||||||
}
|
}
|
||||||
// Returns error in case of any error.
|
// Returns error in case of any error.
|
||||||
error_if_any_error(results)
|
merge_exitcodes(results)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn batch(
|
pub fn batch(
|
||||||
|
@ -23,7 +23,7 @@ impl ExitCode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn error_if_any_error(results: Vec<ExitCode>) -> ExitCode {
|
pub fn merge_exitcodes(results: Vec<ExitCode>) -> ExitCode {
|
||||||
if results.iter().any(ExitCode::is_error) {
|
if results.iter().any(ExitCode::is_error) {
|
||||||
return ExitCode::GeneralError;
|
return ExitCode::GeneralError;
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
// according to those terms.
|
// according to those terms.
|
||||||
|
|
||||||
use crate::exec;
|
use crate::exec;
|
||||||
use crate::exit_codes::{ExitCode, error_if_any_error};
|
use crate::exit_codes::{ExitCode, merge_exitcodes};
|
||||||
use crate::fshelper;
|
use crate::fshelper;
|
||||||
use crate::internal::{opts::FdOptions, osstr_to_bytes, MAX_BUFFER_LENGTH};
|
use crate::internal::{opts::FdOptions, osstr_to_bytes, MAX_BUFFER_LENGTH};
|
||||||
use crate::output;
|
use crate::output;
|
||||||
@ -182,7 +182,7 @@ fn spawn_receiver(
|
|||||||
results.push(h.join().unwrap());
|
results.push(h.join().unwrap());
|
||||||
}
|
}
|
||||||
|
|
||||||
error_if_any_error(results)
|
merge_exitcodes(results)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let start = time::Instant::now();
|
let start = time::Instant::now();
|
||||||
|
Loading…
Reference in New Issue
Block a user