-
Notifications
You must be signed in to change notification settings - Fork 17
Fix multiple TODOs #89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: skalman/fix-audit-findings
Are you sure you want to change the base?
Changes from all commits
103178c
5dd8139
adeb630
0ccb8c4
2522a39
e6a09b8
feab2bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,9 +63,10 @@ impl<'a, E: EngineBLS> Signed for &'a Delinearized<E> { | |
|
|
||
| type M = &'a Message; | ||
| type PKG = &'a PublicKey<Self::E>; | ||
| type PKnM = ::std::collections::hash_map::Iter<'a, Message, PublicKey<E>>; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe the explicit use of hash_map was intentional to impose the hash_map's orders, do we know for sure if we remove the hash_map we get the same ordering?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The type of the value returned from |
||
|
|
||
| fn messages_and_publickeys(self) -> Self::PKnM { | ||
| fn messages_and_publickeys( | ||
| self, | ||
| ) -> impl Iterator<Item = (&'a Message, &'a PublicKey<E>)> + ExactSizeIterator { | ||
| self.messages_n_publickeys.iter() | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain me that how is replacing Once with ExactSizeIterator works?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PKnMis removed from the trait definition and as the bound there wasPKnM: Iterator<Item = (Self::M, Self::PKG)> + ExactSizeIteratorwe can use this bound as return type formessages_and_publickeys, while the actual return type will stay::core::iter::Once<(Message, PublicKey<E>)>which implements bothIteratorandExactSizeIterator