From b667fce8ba6e7801e3e1bfdd888cd9a1b03f562a Mon Sep 17 00:00:00 2001 From: nathanross Date: Tue, 23 Aug 2016 08:57:13 -0400 Subject: [PATCH] clone atpath to avoid borrow issue --- tests/common/macros.rs | 4 +--- tests/common/util.rs | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/common/macros.rs b/tests/common/macros.rs index 54fbcab58..e36fdffdc 100644 --- a/tests/common/macros.rs +++ b/tests/common/macros.rs @@ -61,8 +61,6 @@ macro_rules! new_ucmd { macro_rules! at_and_ucmd { () => ({ let ts = TestScenario::new(util_name!()); - #[allow(unused_mut)] - let mut ucmd = ts.ucmd(); - (ts.fixtures, ucmd) + (ts.fixtures.clone(), ts.ucmd()) }) } diff --git a/tests/common/util.rs b/tests/common/util.rs index da05d4c38..3c20fdb2c 100644 --- a/tests/common/util.rs +++ b/tests/common/util.rs @@ -181,6 +181,7 @@ pub fn get_root_path() -> &'static str { /// Object-oriented path struct that represents and operates on /// paths relative to the directory it was constructed for. +#[derive(Clone)] pub struct AtPath { pub subdir: PathBuf, }