From 69ff505338d1b2e2f797e45de677b21eaf6c0122 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Wed, 5 Jan 2022 15:08:13 -0800 Subject: [PATCH] view: replace `start_modification()` by `Clone` impl I'm pretty sure the `start_modification()` function is a leftover from when there was `ReadonlyView` and `MutableView`. --- lib/src/repo.rs | 2 +- lib/src/view.rs | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/src/repo.rs b/lib/src/repo.rs index a2e755685..f969c15af 100644 --- a/lib/src/repo.rs +++ b/lib/src/repo.rs @@ -431,7 +431,7 @@ impl MutableRepo { index: Arc, view: &View, ) -> MutableRepo { - let mut_view = view.start_modification(); + let mut_view = view.clone(); let mut_index = MutableIndex::incremental(index); MutableRepo { base_repo, diff --git a/lib/src/view.rs b/lib/src/view.rs index 787585f7c..e37fab5e3 100644 --- a/lib/src/view.rs +++ b/lib/src/view.rs @@ -28,7 +28,7 @@ pub enum RefName { GitRef(String), } -#[derive(PartialEq, Eq, Debug)] +#[derive(PartialEq, Eq, Debug, Clone)] pub struct View { data: op_store::View, } @@ -40,13 +40,6 @@ impl View { } } - pub fn start_modification(&self) -> View { - // TODO: Avoid the cloning of the sets here. - View { - data: self.data.clone(), - } - } - pub fn checkout(&self) -> &CommitId { &self.data.checkout }