Skip to content

Commit

Permalink
bugfix: Fix new nightly errors
Browse files Browse the repository at this point in the history
- Use i32::MAX instead of std::i32::MAX
- Add "expected cfg" lints to Cargo.toml

Signed-off-by: John Nunley <dev@notgull.net>
  • Loading branch information
notgull committed May 29, 2024
1 parent cf2d60e commit 2af3a5e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ exclude = ["/.*"]
[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(polling_test_poll_backend)', 'cfg(polling_test_epoll_pipe)'] }

[dependencies]
cfg-if = "1"
tracing = { version = "0.1.37", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion src/epoll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ impl Poller {
(_, Some(t)) if t == Duration::from_secs(0) => 0,
(None, Some(t)) => {
// Round up to a whole millisecond.
let mut ms = t.as_millis().try_into().unwrap_or(std::i32::MAX);
let mut ms = t.as_millis().try_into().unwrap_or(i32::MAX);
if Duration::from_millis(ms as u64) < t {
ms = ms.saturating_add(1);
}
Expand Down

0 comments on commit 2af3a5e

Please sign in to comment.