From d47714569471b7e622283cd3e9292e8d0899cc71 Mon Sep 17 00:00:00 2001 From: "andy.boot" Date: Sat, 20 Aug 2022 10:22:35 +0100 Subject: [PATCH] Tests refactor: Neaten test --- tests/test_exact_output.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_exact_output.rs b/tests/test_exact_output.rs index 465171e..65e3858 100644 --- a/tests/test_exact_output.rs +++ b/tests/test_exact_output.rs @@ -25,12 +25,12 @@ fn copy_test_data(dir: &str) { .arg("/tmp/".to_owned() + &*last_part_of_dir) .ok(); - match Command::new("cp").arg("-r").arg(dir).arg("/tmp/").ok() { - Ok(_) => {} - Err(err) => { - eprintln!("Error copying directory {:?}", err); - } - }; + let _ = Command::new("cp") + .arg("-r") + .arg(dir) + .arg("/tmp/") + .ok() + .map_err(|err| eprintln!("Error copying directory for test setup\n{:?}", err)); } fn initialize() {