Skip to content

Commit 3235ef6

Browse files
committed
cell -> py2
1 parent 6799863 commit 3235ef6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/pycell.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,12 @@ impl<T: PyClass> IntoPy<PyObject> for &'_ PyRef<'_, T> {
772772
}
773773
}
774774

775+
impl<'a, T: PyClass> From<&'a PyCell<T>> for crate::Py2<'a, T> {
776+
fn from(cell: &'a crate::PyCell<T>) -> Self {
777+
Py2::borrowed_from_gil_ref(&cell).clone()
778+
}
779+
}
780+
775781
impl<'a, T: PyClass> std::convert::TryFrom<&'a PyCell<T>> for crate::PyRef<'a, T> {
776782
type Error = PyBorrowError;
777783
fn try_from(cell: &'a crate::PyCell<T>) -> Result<Self, Self::Error> {

0 commit comments

Comments
 (0)