Mercurial > hg
diff rust/hg-cpython/src/dirstate/dirstate_map.rs @ 42890:74d67c645278
rust-cpython: remove Option<_> from interface of py_shared_iterator
It's the implementation detail of the py_shared_iterator that the leaked
reference is kept in Option<_> so that it can be dropped early.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 08 Sep 2019 13:08:59 +0900 |
parents | ea91a126c803 |
children | 7a01778bc7b7 |
line wrap: on
line diff
--- a/rust/hg-cpython/src/dirstate/dirstate_map.rs Sun Sep 08 12:26:12 2019 +0900 +++ b/rust/hg-cpython/src/dirstate/dirstate_map.rs Sun Sep 08 13:08:59 2019 +0900 @@ -323,7 +323,7 @@ let (leak_handle, leaked_ref) = unsafe { self.leak_immutable(py)? }; DirstateMapKeysIterator::from_inner( py, - Some(leak_handle), + leak_handle, leaked_ref.iter(), ) } @@ -332,7 +332,7 @@ let (leak_handle, leaked_ref) = unsafe { self.leak_immutable(py)? }; DirstateMapItemsIterator::from_inner( py, - Some(leak_handle), + leak_handle, leaked_ref.iter(), ) } @@ -341,7 +341,7 @@ let (leak_handle, leaked_ref) = unsafe { self.leak_immutable(py)? }; DirstateMapKeysIterator::from_inner( py, - Some(leak_handle), + leak_handle, leaked_ref.iter(), ) } @@ -438,7 +438,7 @@ let (leak_handle, leaked_ref) = unsafe { self.leak_immutable(py)? }; CopyMapKeysIterator::from_inner( py, - Some(leak_handle), + leak_handle, leaked_ref.copy_map.iter(), ) } @@ -447,7 +447,7 @@ let (leak_handle, leaked_ref) = unsafe { self.leak_immutable(py)? }; CopyMapItemsIterator::from_inner( py, - Some(leak_handle), + leak_handle, leaked_ref.copy_map.iter(), ) }