Mercurial > hg
comparison rust/hg-cpython/src/dirstate/dirs_multiset.rs @ 43430:8418b77132c1
rust-cpython: remove useless PyResult<> from leak_immutable()
The caller should know if the shared data is mutably borrowed or not.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 05 Oct 2019 09:33:01 -0400 |
parents | b9f791090211 |
children | 1fe2e574616e |
comparison
equal
deleted
inserted
replaced
43429:75b4eb98ad97 | 43430:8418b77132c1 |
---|---|
90 } | 90 } |
91 } | 91 } |
92 }) | 92 }) |
93 } | 93 } |
94 def __iter__(&self) -> PyResult<DirsMultisetKeysIterator> { | 94 def __iter__(&self) -> PyResult<DirsMultisetKeysIterator> { |
95 let leaked_ref = self.inner_shared(py).leak_immutable()?; | 95 let leaked_ref = self.inner_shared(py).leak_immutable(); |
96 DirsMultisetKeysIterator::from_inner( | 96 DirsMultisetKeysIterator::from_inner( |
97 py, | 97 py, |
98 unsafe { leaked_ref.map(py, |o| o.iter()) }, | 98 unsafe { leaked_ref.map(py, |o| o.iter()) }, |
99 ) | 99 ) |
100 } | 100 } |