mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
lifetime bounded TryFromBorrwoedObject
This commit is contained in:
1 parent
0f24d66234
commit
f314328294
15 files changed
+53
-38
No files matched your search
@@ -86,8 +86,8 @@ python_person.name: {}",
|
||||
name: String,
|
||||
}
|
||||
|
||||
impl TryFromBorrowedObject for PythonPerson {
|
||||
fn try_from_borrowed_object(vm: &VirtualMachine, obj: &PyObject) -> PyResult<Self> {
|
||||
impl<'a> TryFromBorrowedObject<'a> for PythonPerson {
|
||||
fn try_from_borrowed_object(vm: &VirtualMachine, obj: &'a PyObject) -> PyResult<Self> {
|
||||
let name = obj.get_attr("name", vm)?.try_into_value::<String>(vm)?;
|
||||
Ok(PythonPerson { name })
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user