Replace vm.extract_elements with TryFromBorrowedObject

This commit is contained in:
Jeong Yunwon
2022-04-17 06:01:35 +09:00
parent fac28934f6
commit 828c28ebb8
23 changed files with 64 additions and 66 deletions

View File

@@ -150,8 +150,9 @@ impl<T> ArgSequence<T> {
&self.0
}
}
impl<T: TryFromObject> TryFromObject for ArgSequence<T> {
fn try_from_object(vm: &VirtualMachine, obj: PyObjectRef) -> PyResult<Self> {
vm.extract_elements(&obj).map(Self)
obj.try_to_value(vm).map(Self)
}
}