Skip to content

Commit

Permalink
fix: make things compile with no default features
Browse files Browse the repository at this point in the history
Testing with the `--no-default-features` did not work. This commit fixes it
and also improves the CI, so that it doesn't happen again.
  • Loading branch information
vmx committed Mar 25, 2024
1 parent b3aba6f commit c61ec52
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,24 @@ jobs:

- name: Check Code Format
run: cargo fmt --all -- --check
shell: bash

- name: Code Lint
- name: Code lint with default features
run: cargo clippy --all-targets --workspace -- -D warnings
shell: bash

- name: Test
- name: Code lint without default features
run: cargo clippy --all-targets --workspace --no-default-features -- -D warnings

- name: Code lint with all features
run: cargo clippy --all-targets --workspace --all-features -- -D warnings

- name: Test with default features
run: cargo test --all-targets --workspace
shell: bash

- name: Test without default features
run: cargo test --all-targets --workspace --no-default-features

- name: Test with all features
run: cargo test --all-targets --workspace --all-features

- name: Test no-cid-as-bytes feature
run: cargo test --all-targets --workspace --features no-cid-as-bytes
shell: bash
4 changes: 1 addition & 3 deletions src/ser.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//! Serialization.
#[cfg(not(feature = "std"))]
use alloc::collections::TryReserveError;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use alloc::{collections::TryReserveError, string::ToString, vec::Vec};
#[cfg(feature = "std")]
use std::collections::TryReserveError;

Expand Down

0 comments on commit c61ec52

Please sign in to comment.