Skip to content

Commit

Permalink
Don't send duplicate events.
Browse files Browse the repository at this point in the history
  • Loading branch information
dvc94ch committed Nov 17, 2020
1 parent 2864c69 commit 93289a1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ impl IfWatcher {
}

pub fn iter(&self) -> impl Iterator<Item = &IpNet> {
self.hash.iter()
self.hash.iter().filter(move |inet| {
self.queue.iter().find(|ev| **ev == IfEvent::Up(**inet)).is_none()
})
}

/// Returns a future for the next event.
Expand Down

0 comments on commit 93289a1

Please sign in to comment.