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:
codingpeanut157
2025-11-03 15:19:52 +01:00
committed by GitHub
parent c6434b88d1
commit c68c5288f2

View File

@@ -930,7 +930,10 @@ impl Iterator for PreMintSecrets {
fn next(&mut self) -> Option<Self::Item> {
// Use the iterator of the vector
self.secrets.pop()
if self.secrets.is_empty() {
return None;
}
Some(self.secrets.remove(0))
}
}