-
Notifications
You must be signed in to change notification settings - Fork 1
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
Use filter fn #25
Use filter fn #25
Conversation
Ah, will also implement the double |
4b195a0
to
32635f5
Compare
where | ||
I: Iterator<Item = &'a SentPacket>, | ||
{ | ||
lost_packets: impl IntoIterator<Item = &'a SentPacket>, |
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.
Using IntoIterator
instead of Iterator
allows other code to still pass a Vec
, thus reducing the diff of the pull request.
where | ||
I: Iterator<Item = &'a SentPacket>, | ||
{ | ||
lost_packets: impl IntoIterator<Item = &'a SentPacket>, |
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.
impl XXX
is just suggar code for a proper where
block declaration.
Follow-up on mozilla#1903 (comment)
/// Allows filtering packets without holding a reference to [`Pmtud`]. When | ||
/// in doubt, use [`Pmtud::is_pmtud_probe`]. | ||
pub fn is_probe_filter(&self) -> impl Fn(&SentPacket) -> bool { | ||
let probe_state = Probe::Sent; |
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.
@mxinden This would need to be let probe_state = self.probe_state;
, and then I again get borrow checker issues.
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.
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.
My bad. Yes. Thanks!
Follow-up on mozilla#1903 (comment)