mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
Replace vm.extract_elements with TryFromBorrowedObject
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user