mirror of
https://github.com/aljazceru/cdk.git
synced 2025-12-20 14:14:49 +01:00
PreMintSecrets: fix into_iter() (#1244)
extracting elements from the vector using `Vec::pop` returns the elements in the reverse order. This commits fixes the bug by using `Vec::remove(0)`
This commit is contained in:
@@ -930,7 +930,10 @@ impl Iterator for PreMintSecrets {
|
|||||||
|
|
||||||
fn next(&mut self) -> Option<Self::Item> {
|
fn next(&mut self) -> Option<Self::Item> {
|
||||||
// Use the iterator of the vector
|
// Use the iterator of the vector
|
||||||
self.secrets.pop()
|
if self.secrets.is_empty() {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
Some(self.secrets.remove(0))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user