diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 7a52634..b10df3b 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -2,9 +2,9 @@ name: checks on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] # allow manual trigger workflow_dispatch: @@ -20,51 +20,22 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] rust: + - 1.63 # MSRV from Cargo.toml - 1.84.1 # pre edition2024 - 1.87 - stable + - nightly steps: - - uses: actions/checkout@v2 - - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{matrix.rust}} - override: true - - - name: Build lib - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose - - name: Build examples - run: cargo build --example '*' - - style: - name: Style checks for ${{matrix.rust}} on ${{matrix.os}} - runs-on: ${{matrix.os}} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - rust: - - 1.84.1 # pre edition2024 - - 1.87 # clippy became more picky after this - - stable - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@v1 with: - profile: minimal - toolchain: ${{matrix.rust}} - override: true components: rustfmt, clippy + toolchain: ${{matrix.rust}} + - name: Build lib + run: cargo build --verbose --all-targets --all-features + - name: Run tests + run: cargo test --verbose - name: fmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + run: cargo fmt --all -- --check - name: clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --all-targets --all-features -- -D warnings + run: cargo clippy --all-targets --all-features -- -D warnings diff --git a/Cargo.toml b/Cargo.toml index f1d99c1..012f09c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,7 @@ readme = "README.md" keywords = ["patch", "diff", "parse", "nom"] license = "MIT" edition = "2018" +rust-version = "1.63" # matches .github/workflows/checks.yml [dependencies] nom = "7.1.0" diff --git a/src/ast.rs b/src/ast.rs index d923f10..48374c4 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -299,7 +299,7 @@ mod tests { range_hint: "", lines: vec![], }; - for (input, expected) in vec![ + for (input, expected) in [ ("", None), (" ", None), (" ", None),