diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 03ddb63..be51463 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -6,44 +6,28 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - components: rustfmt - toolchain: stable - profile: minimal - override: true - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + - name: Setup Rust toolchain + run: rustup show && rustup update + - name: cargo fmt + run: cargo fmt --all -- --check clippy: name: cargo clippy runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - components: clippy - toolchain: stable - profile: minimal - override: true - - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -D warnings + - name: Setup Rust toolchain + run: rustup show && rustup update + - name: cargo clippy + run: cargo clippy --workspace --all-features --tests -- -D warnings readme: name: cargo readme runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - override: true - - run: cargo install cargo-readme + - uses: dtolnay/rust-toolchain@stable + - run: cargo +stable install cargo-readme - run: cd ciborium-io && cargo readme > README.md - run: cd ciborium-ll && cargo readme > README.md - run: cd ciborium && cargo readme > README.md diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 750aa66..2e10565 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,14 +6,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.toolchain }} - override: true - - uses: actions-rs/cargo@v1 - with: - command: test - args: --manifest-path=${{ matrix.crates.name }}/Cargo.toml ${{ matrix.profile.flag }} --no-default-features --features=${{ matrix.crates.feat }} + - name: Install Rust + run: rustup toolchain install ${{ matrix.toolchain }} + - name: cargo test + run: cargo +${{ matrix.toolchain }} test --manifest-path=${{ matrix.crates.name }}/Cargo.toml ${{ matrix.profile.flag }} --no-default-features --features=${{ matrix.crates.feat }} strategy: fail-fast: false matrix: diff --git a/ciborium-ll/src/lib.rs b/ciborium-ll/src/lib.rs index c02ba49..5b47ba9 100644 --- a/ciborium-ll/src/lib.rs +++ b/ciborium-ll/src/lib.rs @@ -472,8 +472,8 @@ mod tests { // Test decoding let mut decoder = Decoder::from(&bytes[..]); - for header in headers.iter().cloned() { - assert_eq!(header, decoder.pull().unwrap()); + for header in headers.iter() { + assert_eq!(*header, decoder.pull().unwrap()); } // Test encoding diff --git a/ciborium/tests/tag.rs b/ciborium/tests/tag.rs index c19ee00..4664d57 100644 --- a/ciborium/tests/tag.rs +++ b/ciborium/tests/tag.rs @@ -43,7 +43,7 @@ fn test( match from_reader(&bytes[..]) { Ok(x) if success => assert_eq!(item, x), Ok(..) => panic!("unexpected success"), - Err(e) if success => Err(e).unwrap(), + Err(e) if success => panic!("{:?}", e), Err(..) => (), } @@ -51,7 +51,7 @@ fn test( match value.deserialized() { Ok(x) if success => assert_eq!(item, x), Ok(..) => panic!("unexpected success"), - Err(e) if success => Err(e).unwrap(), + Err(e) if success => panic!("{:?}", e), Err(..) => (), } }