mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-25 14:57:32 -05:00
commit
0f71e12235
3 changed files with 15 additions and 15 deletions
23
.github/workflows/rust.yml
vendored
23
.github/workflows/rust.yml
vendored
|
@ -18,25 +18,26 @@ jobs:
|
||||||
fmt:
|
fmt:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
- uses: DavidAnson/markdownlint-cli2-action@v16
|
||||||
with:
|
|
||||||
components: rustfmt
|
|
||||||
- uses: DavidAnson/markdownlint-cli2-action@v9
|
|
||||||
with:
|
with:
|
||||||
globs: "exercises/**/*.md"
|
globs: "exercises/**/*.md"
|
||||||
- name: Run cargo fmt
|
- name: Run cargo fmt
|
||||||
run: |
|
run: cargo fmt --all -- --check
|
||||||
cargo fmt --all -- --check
|
|
||||||
test:
|
test:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, windows-latest, macOS-latest]
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
|
||||||
- uses: swatinem/rust-cache@v2
|
- uses: swatinem/rust-cache@v2
|
||||||
- name: Run cargo test
|
- name: Run cargo test
|
||||||
run: |
|
run: cargo test
|
||||||
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
|
||||||
|
|
3
.github/workflows/web.yml
vendored
3
.github/workflows/web.yml
vendored
|
@ -54,10 +54,9 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
# Setup
|
# Setup
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
|
||||||
- uses: swatinem/rust-cache@v2
|
- uses: swatinem/rust-cache@v2
|
||||||
|
|
||||||
# If you use any mdbook plugins, here's the place to install them!
|
# If you use any mdbook plugins, here's the place to install them!
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
// `hour_of_day` is higher than 23.
|
// `hour_of_day` is higher than 23.
|
||||||
fn maybe_icecream(hour_of_day: u16) -> Option<u16> {
|
fn maybe_icecream(hour_of_day: u16) -> Option<u16> {
|
||||||
match hour_of_day {
|
match hour_of_day {
|
||||||
0..22 => Some(5),
|
0..=21 => Some(5),
|
||||||
22..24 => Some(0),
|
22..=23 => Some(0),
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue