mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-05 02:20: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 {
|
||||
type Item = (String, String, Export);
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
self.elements.pop_front()
|
||||
}
|
||||
|
||||
fn size_hint(&self) -> (usize, Option<usize>) {
|
||||
let len = self.elements.len();
|
||||
|
||||
(len, Some(len))
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoIterator for ImportObject {
|
||||
|
Loading…
Reference in New Issue
Block a user