Mercurial > public > mercurial-scm > hg
diff rust/hg-cpython/src/dirstate/dirstate_map.rs @ 47112:d5956136d19d
dirstate-tree: Give to `status()` mutable access to the `DirstateMap`
Differential Revision: https://phab.mercurial-scm.org/D10546
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Fri, 16 Apr 2021 12:12:04 +0200 |
parents | 33e5511b571a |
children | b6339a993b91 |
line wrap: on
line diff
--- a/rust/hg-cpython/src/dirstate/dirstate_map.rs Tue Apr 06 15:49:01 2021 +0200 +++ b/rust/hg-cpython/src/dirstate/dirstate_map.rs Fri Apr 16 12:12:04 2021 +0200 @@ -8,7 +8,7 @@ //! Bindings for the `hg::dirstate::dirstate_map` file provided by the //! `hg-core` package. -use std::cell::{Ref, RefCell}; +use std::cell::{RefCell, RefMut}; use std::convert::TryInto; use cpython::{ @@ -527,11 +527,11 @@ }); impl DirstateMap { - pub fn get_inner<'a>( + pub fn get_inner_mut<'a>( &'a self, py: Python<'a>, - ) -> Ref<'a, Box<dyn DirstateMapMethods + Send>> { - self.inner(py).borrow() + ) -> RefMut<'a, Box<dyn DirstateMapMethods + Send>> { + self.inner(py).borrow_mut() } fn translate_key( py: Python,