Skip to content
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

Merged
merged 2 commits into from
Jul 10, 2024
Merged

Use filter fn #25

merged 2 commits into from
Jul 10, 2024

Conversation

mxinden
Copy link

@mxinden mxinden commented Jul 10, 2024

Follow-up on mozilla#1903 (comment)

@mxinden mxinden requested a review from larseggert as a code owner July 10, 2024 07:33
@mxinden
Copy link
Author

mxinden commented Jul 10, 2024

Ah, will also implement the double rev peekable. Give me one sec.

@mxinden mxinden force-pushed the feat-dplpmtud branch 2 times, most recently from 4b195a0 to 32635f5 Compare July 10, 2024 07:40
where
I: Iterator<Item = &'a SentPacket>,
{
lost_packets: impl IntoIterator<Item = &'a SentPacket>,
Copy link
Author

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>,
Copy link
Author

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.

@larseggert larseggert merged commit 3a3d554 into larseggert:feat-dplpmtud Jul 10, 2024
2 checks passed
/// 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;
Copy link
Owner

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.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mxinden I fixed this in 8d1d1cd, let me know if that looks OK.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad. Yes. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants