Merge pull request #132 from stjepang/update-wepoll

Update wepoll-binding to 2.0.2
This commit is contained in:
Stjepan Glavina 2020-05-23 09:24:33 -07:00 committed by GitHub
commit c311b6897f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View File

@ -45,7 +45,7 @@ optional = true
nix = "0.17.0" nix = "0.17.0"
[target.'cfg(windows)'.dependencies] [target.'cfg(windows)'.dependencies]
wepoll-binding = "2.0.0" wepoll-binding = "2.0.2"
[dev-dependencies] [dev-dependencies]
futures = { version = "0.3.5", default-features = false, features = ["std"] } futures = { version = "0.3.5", default-features = false, features = ["std"] }

View File

@ -714,11 +714,9 @@ mod sys {
Events(wepoll_binding::Events::with_capacity(1000)) Events(wepoll_binding::Events::with_capacity(1000))
} }
pub fn iter(&self) -> impl Iterator<Item = Event> + '_ { pub fn iter(&self) -> impl Iterator<Item = Event> + '_ {
// wepoll doesn't report events so we have to assume both readability and writabilit
// events have been emitted.
self.0.iter().map(|ev| Event { self.0.iter().map(|ev| Event {
readable: true, readable: ev.flags().intersects(read_flags()),
writable: true, writable: ev.flags().intersects(write_flags()),
key: ev.data() as usize, key: ev.data() as usize,
}) })
} }