Show More
@@ -92,7 +92,8 py_class!(pub class Dirs |py| { | |||||
92 | }) |
|
92 | }) | |
93 | } |
|
93 | } | |
94 | def __iter__(&self) -> PyResult<DirsMultisetKeysIterator> { |
|
94 | def __iter__(&self) -> PyResult<DirsMultisetKeysIterator> { | |
95 |
let (leak_handle, leaked_ref) = |
|
95 | let (leak_handle, leaked_ref) = | |
|
96 | unsafe { self.inner_shared(py).leak_immutable()? }; | |||
96 | DirsMultisetKeysIterator::from_inner( |
|
97 | DirsMultisetKeysIterator::from_inner( | |
97 | py, |
|
98 | py, | |
98 | leak_handle, |
|
99 | leak_handle, |
@@ -319,7 +319,8 py_class!(pub class DirstateMap |py| { | |||||
319 | } |
|
319 | } | |
320 |
|
320 | |||
321 | def keys(&self) -> PyResult<DirstateMapKeysIterator> { |
|
321 | def keys(&self) -> PyResult<DirstateMapKeysIterator> { | |
322 |
let (leak_handle, leaked_ref) = |
|
322 | let (leak_handle, leaked_ref) = | |
|
323 | unsafe { self.inner_shared(py).leak_immutable()? }; | |||
323 | DirstateMapKeysIterator::from_inner( |
|
324 | DirstateMapKeysIterator::from_inner( | |
324 | py, |
|
325 | py, | |
325 | leak_handle, |
|
326 | leak_handle, | |
@@ -328,7 +329,8 py_class!(pub class DirstateMap |py| { | |||||
328 | } |
|
329 | } | |
329 |
|
330 | |||
330 | def items(&self) -> PyResult<DirstateMapItemsIterator> { |
|
331 | def items(&self) -> PyResult<DirstateMapItemsIterator> { | |
331 |
let (leak_handle, leaked_ref) = |
|
332 | let (leak_handle, leaked_ref) = | |
|
333 | unsafe { self.inner_shared(py).leak_immutable()? }; | |||
332 | DirstateMapItemsIterator::from_inner( |
|
334 | DirstateMapItemsIterator::from_inner( | |
333 | py, |
|
335 | py, | |
334 | leak_handle, |
|
336 | leak_handle, | |
@@ -337,7 +339,8 py_class!(pub class DirstateMap |py| { | |||||
337 | } |
|
339 | } | |
338 |
|
340 | |||
339 | def __iter__(&self) -> PyResult<DirstateMapKeysIterator> { |
|
341 | def __iter__(&self) -> PyResult<DirstateMapKeysIterator> { | |
340 |
let (leak_handle, leaked_ref) = |
|
342 | let (leak_handle, leaked_ref) = | |
|
343 | unsafe { self.inner_shared(py).leak_immutable()? }; | |||
341 | DirstateMapKeysIterator::from_inner( |
|
344 | DirstateMapKeysIterator::from_inner( | |
342 | py, |
|
345 | py, | |
343 | leak_handle, |
|
346 | leak_handle, | |
@@ -454,7 +457,8 py_class!(pub class DirstateMap |py| { | |||||
454 | } |
|
457 | } | |
455 |
|
458 | |||
456 | def copymapiter(&self) -> PyResult<CopyMapKeysIterator> { |
|
459 | def copymapiter(&self) -> PyResult<CopyMapKeysIterator> { | |
457 |
let (leak_handle, leaked_ref) = |
|
460 | let (leak_handle, leaked_ref) = | |
|
461 | unsafe { self.inner_shared(py).leak_immutable()? }; | |||
458 | CopyMapKeysIterator::from_inner( |
|
462 | CopyMapKeysIterator::from_inner( | |
459 | py, |
|
463 | py, | |
460 | leak_handle, |
|
464 | leak_handle, | |
@@ -463,7 +467,8 py_class!(pub class DirstateMap |py| { | |||||
463 | } |
|
467 | } | |
464 |
|
468 | |||
465 | def copymapitemsiter(&self) -> PyResult<CopyMapItemsIterator> { |
|
469 | def copymapitemsiter(&self) -> PyResult<CopyMapItemsIterator> { | |
466 |
let (leak_handle, leaked_ref) = |
|
470 | let (leak_handle, leaked_ref) = | |
|
471 | unsafe { self.inner_shared(py).leak_immutable()? }; | |||
467 | CopyMapItemsIterator::from_inner( |
|
472 | CopyMapItemsIterator::from_inner( | |
468 | py, |
|
473 | py, | |
469 | leak_handle, |
|
474 | leak_handle, |
@@ -319,14 +319,6 macro_rules! py_shared_ref { | |||||
319 | { |
|
319 | { | |
320 | self.$shared_accessor(py).borrow_mut() |
|
320 | self.$shared_accessor(py).borrow_mut() | |
321 | } |
|
321 | } | |
322 |
|
||||
323 | // TODO: remove this function in favor of $shared_accessor(py) |
|
|||
324 | unsafe fn leak_immutable<'a>( |
|
|||
325 | &'a self, |
|
|||
326 | py: Python<'a>, |
|
|||
327 | ) -> PyResult<(PyLeakedRef, &'static $inner_struct)> { |
|
|||
328 | self.$shared_accessor(py).leak_immutable() |
|
|||
329 | } |
|
|||
330 | } |
|
322 | } | |
331 | }; |
|
323 | }; | |
332 | } |
|
324 | } | |
@@ -396,7 +388,8 impl Drop for PyLeakedRef { | |||||
396 | /// data inner: PySharedRefCell<MyStruct>; |
|
388 | /// data inner: PySharedRefCell<MyStruct>; | |
397 | /// |
|
389 | /// | |
398 | /// def __iter__(&self) -> PyResult<MyTypeItemsIterator> { |
|
390 | /// def __iter__(&self) -> PyResult<MyTypeItemsIterator> { | |
399 |
/// let (leak_handle, leaked_ref) = |
|
391 | /// let (leak_handle, leaked_ref) = | |
|
392 | /// unsafe { self.inner_shared(py).leak_immutable()? }; | |||
400 | /// MyTypeItemsIterator::from_inner( |
|
393 | /// MyTypeItemsIterator::from_inner( | |
401 | /// py, |
|
394 | /// py, | |
402 | /// leak_handle, |
|
395 | /// leak_handle, |
General Comments 0
You need to be logged in to leave comments.
Login now