lifetime bounded TryFromBorrwoedObject

This commit is contained in:
Jeong YunWon committed 2023-03-19 04:57:06 +09:00
1 parent 0f24d66234
commit f314328294
15 files changed
+53 -38

No files matched your search

+2 -2
View File
@@ -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 })
}