mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 03:04:38 +08:00
lenhint -> length_hint
This commit is contained in:
1 parent
9cf1f297e9
commit
3e1584cd89
1 file changed
+4
-4
+4
-4
@@ -1030,12 +1030,12 @@ impl<T> PyIterable<T> {
|
||||
},
|
||||
)?;
|
||||
|
||||
let lenhint = objiter::length_hint(vm, iter_obj.clone())?;
|
||||
let length_hint = objiter::length_hint(vm, iter_obj.clone())?;
|
||||
|
||||
Ok(PyIterator {
|
||||
vm,
|
||||
obj: iter_obj,
|
||||
lenhint,
|
||||
length_hint,
|
||||
_item: std::marker::PhantomData,
|
||||
})
|
||||
}
|
||||
@@ -1044,7 +1044,7 @@ impl<T> PyIterable<T> {
|
||||
pub struct PyIterator<'a, T> {
|
||||
vm: &'a VirtualMachine,
|
||||
obj: PyObjectRef,
|
||||
lenhint: Option<usize>,
|
||||
length_hint: Option<usize>,
|
||||
_item: std::marker::PhantomData<T>,
|
||||
}
|
||||
|
||||
@@ -1068,7 +1068,7 @@ where
|
||||
}
|
||||
|
||||
fn size_hint(&self) -> (usize, Option<usize>) {
|
||||
(self.lenhint.unwrap_or(0), self.lenhint)
|
||||
(self.length_hint.unwrap_or(0), self.length_hint)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user