mirror of
https://github.com/fluencelabs/wasmer
synced 2025-04-25 10:22:19 +00:00
Merge #1410
1410: feat(runtime-core) Implement `ImportObjectIterator::size_hint`. r=MarkMcCaskey a=Hywan Because it is helpful in some circumstances. Co-authored-by: Ivan Enderlin <ivan@mnt.io>
This commit is contained in:
commit
86a66e25d8
@ -192,9 +192,16 @@ pub struct ImportObjectIterator {
|
|||||||
|
|
||||||
impl Iterator for ImportObjectIterator {
|
impl Iterator for ImportObjectIterator {
|
||||||
type Item = (String, String, Export);
|
type Item = (String, String, Export);
|
||||||
|
|
||||||
fn next(&mut self) -> Option<Self::Item> {
|
fn next(&mut self) -> Option<Self::Item> {
|
||||||
self.elements.pop_front()
|
self.elements.pop_front()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn size_hint(&self) -> (usize, Option<usize>) {
|
||||||
|
let len = self.elements.len();
|
||||||
|
|
||||||
|
(len, Some(len))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl IntoIterator for ImportObject {
|
impl IntoIterator for ImportObject {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user