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`.
This commit is contained in:
Martin von Zweigbergk 2022-01-05 15:08:13 -08:00
parent 504148a81f
commit 69ff505338
2 changed files with 2 additions and 9 deletions

View file

@ -431,7 +431,7 @@ impl MutableRepo {
index: Arc<ReadonlyIndex>, index: Arc<ReadonlyIndex>,
view: &View, view: &View,
) -> MutableRepo { ) -> MutableRepo {
let mut_view = view.start_modification(); let mut_view = view.clone();
let mut_index = MutableIndex::incremental(index); let mut_index = MutableIndex::incremental(index);
MutableRepo { MutableRepo {
base_repo, base_repo,

View file

@ -28,7 +28,7 @@ pub enum RefName {
GitRef(String), GitRef(String),
} }
#[derive(PartialEq, Eq, Debug)] #[derive(PartialEq, Eq, Debug, Clone)]
pub struct View { pub struct View {
data: op_store::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 { pub fn checkout(&self) -> &CommitId {
&self.data.checkout &self.data.checkout
} }