mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 03:04:38 +08:00
Update stdlib/src/array.rs
Co-authored-by: Snowapril <sinjihng@gmail.com>
This commit is contained in:
1 parent
1a526aff47
commit
50aebefa4c
1 file changed
+4
-6
+4
-6
@@ -1295,12 +1295,10 @@ mod array {
|
||||
impl IterNext for PyArrayIter {
|
||||
fn next(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> {
|
||||
zelf.internal.lock().next(|array, pos| {
|
||||
let r = if let Some(item) = array.read().get(pos, vm) {
|
||||
PyIterReturn::Return(item?)
|
||||
} else {
|
||||
PyIterReturn::StopIteration(None)
|
||||
};
|
||||
Ok(r)
|
||||
Ok(match array.read().get(pos, vm) {
|
||||
Some(item) => PyIterReturn::Return(item?),
|
||||
None => PyIterReturn::StopIteration(None),
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user