Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ impl Poller {
timeout
);

let deadline = timeout.map(|t| Instant::now() + t);
let deadline = timeout.and_then(|t| Instant::now().checked_add(t));

events.inner.clear();

Expand Down
2 changes: 1 addition & 1 deletion src/wepoll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl Poller {
/// included in the `events` list nor contribute to the returned count.
pub fn wait(&self, events: &mut Events, timeout: Option<Duration>) -> io::Result<()> {
log::trace!("wait: handle={:?}, timeout={:?}", self.handle, timeout);
let deadline = timeout.map(|t| Instant::now() + t);
let deadline = timeout.and_then(|t| Instant::now().checked_add(t));

loop {
// Convert the timeout to milliseconds.
Expand Down