rust/hg-cpython/src/dirstate/dirs_multiset.rs
changeset 43284 ce6dd1cee4c8
parent 43180 b3dda04e851b
child 43285 ffc1fbd7d1f5
--- a/rust/hg-cpython/src/dirstate/dirs_multiset.rs	Thu Oct 17 20:40:12 2019 -0700
+++ b/rust/hg-cpython/src/dirstate/dirs_multiset.rs	Sun Sep 15 22:06:19 2019 +0900
@@ -92,8 +92,9 @@
             })
     }
     def __iter__(&self) -> PyResult<DirsMultisetKeysIterator> {
-        let (leak_handle, leaked_ref) =
+        let mut leak_handle =
             unsafe { self.inner_shared(py).leak_immutable()? };
+        let leaked_ref = leak_handle.data.take().unwrap();
         DirsMultisetKeysIterator::from_inner(
             py,
             leak_handle,
@@ -125,7 +126,7 @@
 
 py_shared_iterator!(
     DirsMultisetKeysIterator,
-    PyLeakedRef,
+    PyLeakedRef<&'static DirsMultiset>,
     DirsMultisetIter<'static>,
     Dirs::translate_key,
     Option<PyBytes>