From 3092d87047fbbdab4b22f8d6210997334675fd28 Mon Sep 17 00:00:00 2001 From: Katie Cleary Date: Tue, 17 Jul 2018 10:30:19 -0700 Subject: [PATCH] Remove Drop from Context Prior to this commit, there was a Drop implementation for the Context test helper struct. Since the test helper is made up of temporary directories which clean themselves up when a context goes out of scope, this is unnecessary and could possibly cause problems with how tempdir removes the directories. --- src/utils/test_helper.rs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/utils/test_helper.rs b/src/utils/test_helper.rs index 6b52118..7fc8b13 100644 --- a/src/utils/test_helper.rs +++ b/src/utils/test_helper.rs @@ -18,13 +18,6 @@ pub struct Context { pub repo_dir: PathBuf, } -impl Drop for Context { - fn drop(&mut self) { - rm_rf(self.local.path().parent().unwrap()); - rm_rf(self.remote.path()); - } -} - pub fn setup_fresh() -> Context { // create temporary directory let temp_dir = TempDir::new("rsl_test") @@ -92,10 +85,6 @@ pub fn do_work_on_branch(repo: &Repository, branch_name: &str) -> () { git::add_and_commit(&repo, None, "a commit with some work", branch_name).unwrap(); } -fn rm_rf(path: &Path) { - fs::remove_dir_all(&path).unwrap(); -} - #[cfg(test)] mod tests { use super::*;