From b702802428dda305638ce19be8f74d03e61df812 Mon Sep 17 00:00:00 2001 From: Thomas de Zeeuw Date: Wed, 6 Dec 2023 10:04:48 +0100 Subject: [PATCH 1/5] Switch to edition 2021 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 447d9d8dd..31b178fe8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -edition = "2018" +edition = "2021" name = "mio" # When releasing to crates.io: # - Update CHANGELOG.md. From 6cbc0e77e819723142aa6008aeb45ec5ed21f5f9 Mon Sep 17 00:00:00 2001 From: Thomas de Zeeuw Date: Wed, 6 Dec 2023 10:09:55 +0100 Subject: [PATCH 2/5] Fix Clippy lints in tests --- tests/poll.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/poll.rs b/tests/poll.rs index 22db7b739..a13e360c1 100644 --- a/tests/poll.rs +++ b/tests/poll.rs @@ -581,7 +581,7 @@ fn poll_registration() { let interests = Interest::READABLE; registry.register(&mut source, token, interests).unwrap(); assert_eq!(source.registrations.len(), 1); - assert_eq!(source.registrations.get(0), Some(&(token, interests))); + assert_eq!(source.registrations.first(), Some(&(token, interests))); assert!(source.reregistrations.is_empty()); assert_eq!(source.deregister_count, 0); @@ -593,7 +593,7 @@ fn poll_registration() { assert_eq!(source.registrations.len(), 1); assert_eq!(source.reregistrations.len(), 1); assert_eq!( - source.reregistrations.get(0), + source.reregistrations.first(), Some(&(re_token, re_interests)) ); assert_eq!(source.deregister_count, 0); From 53b93ccb474969ca76d67a32728ca9a5c25aca78 Mon Sep 17 00:00:00 2001 From: Thomas de Zeeuw Date: Wed, 6 Dec 2023 10:10:24 +0100 Subject: [PATCH 3/5] Bump MSRV to v1.74 We can lower it later on when we decide we don't need the latest version, this is being discussed in #1732. --- .github/workflows/ci.yml | 13 +++---------- Cargo.toml | 1 + 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a10a8f7f..fe49cc587 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,22 +75,15 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu-latest", "windows-latest"] - # TODO: once we update our MSRV above 1.53 add macOS again. Currently - # macOS, specifically Xcode 14, broke support for rustc < 1.53. See - # https://github.com/rust-lang/rust/issues/105167. + os: ["ubuntu-latest", "macos-latest", "windows-latest"] steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@master with: - # NOTE: When updating also update Clippy flags, some are disabled due to - # MSRV. - toolchain: 1.46.0 + toolchain: 1.74.0 - name: Check # We only run check allowing us to use newer features in tests. - # We enable all features except for the `log` feature as since log v0.4.19 - # it requires a MSRV later then rustc 1.46. - run: cargo check --no-default-features --features os-poll,os-ext,net + run: cargo check --all-features Nightly: runs-on: ubuntu-latest timeout-minutes: 10 diff --git a/Cargo.toml b/Cargo.toml index 31b178fe8..38ce08ac5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,6 @@ [package] edition = "2021" +rust-version = "1.74" name = "mio" # When releasing to crates.io: # - Update CHANGELOG.md. From ad25ea05326854982e8e57c6f4d5d142ce76fa3e Mon Sep 17 00:00:00 2001 From: Thomas de Zeeuw Date: Wed, 6 Dec 2023 10:12:56 +0100 Subject: [PATCH 4/5] Remove allowed Clippy flags They are no longer triggered. --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe49cc587..aa9293504 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,8 +101,7 @@ jobs: with: components: clippy - name: Clippy - # NOTE: `clippy::uninlined-format-args` is enabled due to MSRV. - run: cargo clippy --all-targets --all-features -- -D warnings -A clippy::cognitive-complexity -A clippy::uninlined-format-args + run: cargo clippy --all-targets --all-features -- -D warnings Docs: runs-on: ubuntu-latest timeout-minutes: 10 From 110eee77d9b3342970465c42af4a15588673f6e4 Mon Sep 17 00:00:00 2001 From: Thomas de Zeeuw Date: Wed, 6 Dec 2023 10:13:11 +0100 Subject: [PATCH 5/5] Remove unused Clippy component from CI --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa9293504..1c73b31de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -129,8 +129,6 @@ jobs: steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable - with: - components: clippy - name: Install all targets run: make install_targets - name: Install Cargo-hack