fn remove_exit_code(exit_code: &Option<i64>, internal_error: &str) -> String {
    if let Some(exit_code) = exit_code {
        regex::Regex::new(&format!(r#"(?i)([,\.]\s*)?exit\s+code(:\s*|\s+){}"#, exit_code)).unwrap()
            .replace(internal_error, "").to_string()
    } else {
        internal_error.to_string()
    }
}
/// Removes exit code from internal error only if it matches exit code of original error
Removes exit code from internal error only if it matches exit code of original error
Removes exit code from internal error only if it matches exit code of original error
fn remove_exit_code(exit_code: &Option<i64>, internal_error: &str) -> String {
    if let Some(exit_code) = exit_code {
        regex::Regex::new(&format!(r#"(?i)([,\.]\s*)?exit\s+code(:\s*|\s+){}"#, exit_code)).unwrap()
            .replace(internal_error, "").to_string()
    } else {
        internal_error.to_string()
    }
}
fn remove_exit_code ( exit_code : & Option < i64 > , internal_error : & str ) -> String { if let Some ( exit_code ) = exit_code { regex :: Regex :: new ( & format ! ( r#"(?i)([,\.]\s*)?exit\s+code(:\s*|\s+){}"# exit_code ) ) . unwrap ( ) . replace ( internal_error , " " ) . to_string ( ) } else { internal_error . to_string ( ) } }
Removes exit code from internal error only if it matches exit code of original error
Removes exit code from internal error only if it matches exit code of original error
exit_code
&Option<i64>
internal_error
&str