Skip to content

Commit

Permalink
cell -> py2
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed Dec 4, 2023
1 parent 6799863 commit 3235ef6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/pycell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,12 @@ impl<T: PyClass> IntoPy<PyObject> for &'_ PyRef<'_, T> {
}
}

impl<'a, T: PyClass> From<&'a PyCell<T>> for crate::Py2<'a, T> {
fn from(cell: &'a crate::PyCell<T>) -> Self {
Py2::borrowed_from_gil_ref(&cell).clone()
}
}

impl<'a, T: PyClass> std::convert::TryFrom<&'a PyCell<T>> for crate::PyRef<'a, T> {
type Error = PyBorrowError;
fn try_from(cell: &'a crate::PyCell<T>) -> Result<Self, Self::Error> {
Expand Down

0 comments on commit 3235ef6

Please sign in to comment.