From 232e3937f291dd3376a2391839a54cf11e484642 Mon Sep 17 00:00:00 2001 From: fusillicode Date: Sat, 22 Feb 2020 09:08:56 +0100 Subject: [PATCH] Rename error_if_any_error to merge_exitcodes --- src/exec/job.rs | 4 ++-- src/exit_codes.rs | 2 +- src/walk.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/exec/job.rs b/src/exec/job.rs index 7e6ce8e..d37899b 100644 --- a/src/exec/job.rs +++ b/src/exec/job.rs @@ -7,7 +7,7 @@ // according to those terms. use super::CommandTemplate; -use crate::exit_codes::{ExitCode, error_if_any_error}; +use crate::exit_codes::{ExitCode, merge_exitcodes}; use crate::walk::WorkerResult; use std::path::PathBuf; use std::sync::mpsc::Receiver; @@ -46,7 +46,7 @@ pub fn job( results.push(cmd.generate_and_execute(&value, Arc::clone(&out_perm))) } // Returns error in case of any error. - error_if_any_error(results) + merge_exitcodes(results) } pub fn batch( diff --git a/src/exit_codes.rs b/src/exit_codes.rs index 731de1d..c2aaacf 100644 --- a/src/exit_codes.rs +++ b/src/exit_codes.rs @@ -23,7 +23,7 @@ impl ExitCode { } } -pub fn error_if_any_error(results: Vec) -> ExitCode { +pub fn merge_exitcodes(results: Vec) -> ExitCode { if results.iter().any(ExitCode::is_error) { return ExitCode::GeneralError; } diff --git a/src/walk.rs b/src/walk.rs index 12c2290..ea9e76d 100644 --- a/src/walk.rs +++ b/src/walk.rs @@ -7,7 +7,7 @@ // according to those terms. use crate::exec; -use crate::exit_codes::{ExitCode, error_if_any_error}; +use crate::exit_codes::{ExitCode, merge_exitcodes}; use crate::fshelper; use crate::internal::{opts::FdOptions, osstr_to_bytes, MAX_BUFFER_LENGTH}; use crate::output; @@ -182,7 +182,7 @@ fn spawn_receiver( results.push(h.join().unwrap()); } - error_if_any_error(results) + merge_exitcodes(results) } } else { let start = time::Instant::now();