diff --git a/rust/hg-core/src/dirstate_tree/dirstate_map.rs b/rust/hg-core/src/dirstate_tree/dirstate_map.rs --- a/rust/hg-core/src/dirstate_tree/dirstate_map.rs +++ b/rust/hg-core/src/dirstate_tree/dirstate_map.rs @@ -909,10 +909,10 @@ #[timed] pub fn pack_v1( - &mut self, + &self, parents: DirstateParents, ) -> Result, DirstateError> { - let map = self.get_map_mut(); + let map = self.get_map(); // Optizimation (to be measured?): pre-compute size to avoid `Vec` // reallocations let mut size = parents.as_bytes().len(); @@ -949,10 +949,10 @@ /// (false). #[timed] pub fn pack_v2( - &mut self, + &self, can_append: bool, ) -> Result<(Vec, Vec, bool), DirstateError> { - let map = self.get_map_mut(); + let map = self.get_map(); on_disk::write(map, can_append) } diff --git a/rust/hg-core/src/dirstate_tree/on_disk.rs b/rust/hg-core/src/dirstate_tree/on_disk.rs --- a/rust/hg-core/src/dirstate_tree/on_disk.rs +++ b/rust/hg-core/src/dirstate_tree/on_disk.rs @@ -549,7 +549,7 @@ /// `dirstate_map.on_disk` (true), instead of written to a new data file /// (false). pub(super) fn write( - dirstate_map: &mut DirstateMap, + dirstate_map: &DirstateMap, can_append: bool, ) -> Result<(Vec, Vec, bool), DirstateError> { let append = can_append && dirstate_map.write_should_append(); diff --git a/rust/hg-cpython/src/dirstate/dirstate_map.rs b/rust/hg-cpython/src/dirstate/dirstate_map.rs --- a/rust/hg-cpython/src/dirstate/dirstate_map.rs +++ b/rust/hg-cpython/src/dirstate/dirstate_map.rs @@ -195,7 +195,7 @@ p1: PyObject, p2: PyObject, ) -> PyResult { - let mut inner = self.inner(py).borrow_mut(); + let inner = self.inner(py).borrow(); let parents = DirstateParents { p1: extract_node_id(py, &p1)?, p2: extract_node_id(py, &p2)?, @@ -217,7 +217,7 @@ &self, can_append: bool, ) -> PyResult { - let mut inner = self.inner(py).borrow_mut(); + let inner = self.inner(py).borrow(); let result = inner.pack_v2(can_append); match result { Ok((packed, tree_metadata, append)) => {