From df64893f2b7abe288d54ab3a7d25e64fee6299b7 Mon Sep 17 00:00:00 2001 From: mo8it Date: Wed, 3 Jul 2024 17:49:41 +0200 Subject: [PATCH 1/5] Update CI --- .github/workflows/rust.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 689d05e1..9edd8eb6 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -18,25 +18,25 @@ jobs: fmt: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: components: rustfmt - - uses: DavidAnson/markdownlint-cli2-action@v9 + - uses: DavidAnson/markdownlint-cli2-action@v16 with: globs: "exercises/**/*.md" - name: Run cargo fmt - run: | - cargo fmt --all -- --check + run: cargo fmt --all -- --check test: runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, windows-latest, macOS-latest] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - uses: swatinem/rust-cache@v2 - name: Run cargo test - run: | - cargo test + run: cargo test + - name: Run rustlings dev check + run: cargo run -- dev check From ad66fe00746f598da929109f934db32018547f90 Mon Sep 17 00:00:00 2001 From: mo8it Date: Wed, 3 Jul 2024 17:51:06 +0200 Subject: [PATCH 2/5] Update checkout in web.yml --- .github/workflows/web.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/web.yml b/.github/workflows/web.yml index 5d9abe4f..0b998afa 100644 --- a/.github/workflows/web.yml +++ b/.github/workflows/web.yml @@ -54,7 +54,7 @@ jobs: runs-on: ubuntu-latest steps: # Setup - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: dtolnay/rust-toolchain@stable From fe3292c170c1ca25c62d56b39168bdbd4f8932e1 Mon Sep 17 00:00:00 2001 From: mo8it Date: Wed, 3 Jul 2024 17:52:44 +0200 Subject: [PATCH 3/5] Remove dtolnay/rust-toolchain --- .github/workflows/rust.yml | 4 ---- .github/workflows/web.yml | 1 - 2 files changed, 5 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9edd8eb6..fafd0b10 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -19,9 +19,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - with: - components: rustfmt - uses: DavidAnson/markdownlint-cli2-action@v16 with: globs: "exercises/**/*.md" @@ -34,7 +31,6 @@ jobs: os: [ubuntu-latest, windows-latest, macOS-latest] steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - uses: swatinem/rust-cache@v2 - name: Run cargo test run: cargo test diff --git a/.github/workflows/web.yml b/.github/workflows/web.yml index 0b998afa..ec5d4462 100644 --- a/.github/workflows/web.yml +++ b/.github/workflows/web.yml @@ -57,7 +57,6 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: dtolnay/rust-toolchain@stable - uses: swatinem/rust-cache@v2 # If you use any mdbook plugins, here's the place to install them! From a72c26bdc3ce59edfbc0d77f83fbcb4e5a7d1fb7 Mon Sep 17 00:00:00 2001 From: mo8it Date: Wed, 3 Jul 2024 17:53:30 +0200 Subject: [PATCH 4/5] Fix solution of options1 for stable Rust --- solutions/12_options/options1.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solutions/12_options/options1.rs b/solutions/12_options/options1.rs index 1ffbb045..230af3af 100644 --- a/solutions/12_options/options1.rs +++ b/solutions/12_options/options1.rs @@ -4,8 +4,8 @@ // `hour_of_day` is higher than 23. fn maybe_icecream(hour_of_day: u16) -> Option { match hour_of_day { - 0..22 => Some(5), - 22..24 => Some(0), + 0..=21 => Some(5), + 22..=23 => Some(0), _ => None, } } From fa6b7d77b2798985bdc7d403c8f300a9c289222c Mon Sep 17 00:00:00 2001 From: mo8it Date: Wed, 3 Jul 2024 17:59:10 +0200 Subject: [PATCH 5/5] Run dev check only on Linux --- .github/workflows/rust.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index fafd0b10..3705e6af 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -34,5 +34,10 @@ jobs: - uses: swatinem/rust-cache@v2 - name: Run cargo test run: cargo test + dev-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: swatinem/rust-cache@v2 - name: Run rustlings dev check run: cargo run -- dev check