From 0aa5f1ae1095fcf06ccbc300b451b2371d108191 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Thu, 12 Oct 2023 14:36:16 -0700 Subject: [PATCH] working copy: rename `working_copy_path()` to just `path()` It seems pretty clear from the context. Turns out we only use the function in a test case. Maybe we don't even need it. It's easy to provide it, though. --- lib/src/local_working_copy.rs | 2 +- lib/src/working_copy.rs | 2 +- lib/tests/test_local_working_copy_sparse.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/local_working_copy.rs b/lib/src/local_working_copy.rs index 80c2447f2..ba8137f32 100644 --- a/lib/src/local_working_copy.rs +++ b/lib/src/local_working_copy.rs @@ -1387,7 +1387,7 @@ impl WorkingCopy for LocalWorkingCopy { "local" } - fn working_copy_path(&self) -> &Path { + fn path(&self) -> &Path { &self.working_copy_path } diff --git a/lib/src/working_copy.rs b/lib/src/working_copy.rs index 0f0715c7e..918f7ef6c 100644 --- a/lib/src/working_copy.rs +++ b/lib/src/working_copy.rs @@ -30,7 +30,7 @@ pub trait WorkingCopy { fn name(&self) -> &str; /// The working copy's root directory. - fn working_copy_path(&self) -> &Path; + fn path(&self) -> &Path; /// The working copy's workspace ID. fn workspace_id(&self) -> &WorkspaceId; diff --git a/lib/tests/test_local_working_copy_sparse.rs b/lib/tests/test_local_working_copy_sparse.rs index fb138830b..ff2e85158 100644 --- a/lib/tests/test_local_working_copy_sparse.rs +++ b/lib/tests/test_local_working_copy_sparse.rs @@ -88,7 +88,7 @@ fn test_sparse_checkout() { // Reload the state to check that it was persisted let mut wc = LocalWorkingCopy::load( repo.store().clone(), - wc.working_copy_path().to_path_buf(), + wc.path().to_path_buf(), wc.state_path().to_path_buf(), ); assert_eq!(