mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
impl AsRef<PyObjectRef> for PyRef<T>
This commit is contained in:
@@ -418,6 +418,15 @@ impl<T: PyObjectPayload> PyRef<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> AsRef<PyObjectRef> for PyRef<T>
|
||||
where
|
||||
T: PyObjectPayload,
|
||||
{
|
||||
fn as_ref(&self) -> &PyObjectRef {
|
||||
&self.obj
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Deref for PyRef<T>
|
||||
where
|
||||
T: PyObjectPayload,
|
||||
|
||||
Reference in New Issue
Block a user