diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48f1479..10fb573 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,9 +44,12 @@ jobs: run: | cargo update -p serde_test --precise 1.0.163 cargo update -p serde --precise 1.0.69 - - name: Tests + - name: Build run: | + cargo build -v --no-default-features cargo build --verbose --features "${{ matrix.features }}" + - name: Tests + run: | cargo doc --verbose --features "${{ matrix.features }}" --no-deps cargo test --verbose --features "${{ matrix.features }}" cargo test --release --verbose --features "${{ matrix.features }}" @@ -54,6 +57,28 @@ jobs: if: matrix.bench != '' run: cargo test -v --benches + nostd: + runs-on: ubuntu-latest + continue-on-error: false + strategy: + matrix: + include: + - rust: stable + target: thumbv6m-none-eabi + features: zeroize + + name: nostd/${{ matrix.target }}/${{ matrix.rust }} + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ matrix.rust }} + targets: ${{ matrix.target }} + - name: Tests + run: | + cargo rustc "--target=${{ matrix.target }}" --no-default-features --features "${{ matrix.features }}" + + miri: runs-on: ubuntu-latest steps: diff --git a/src/array_string.rs b/src/array_string.rs index 8ddc1a2..6833237 100644 --- a/src/array_string.rs +++ b/src/array_string.rs @@ -5,6 +5,7 @@ use std::fmt; use std::hash::{Hash, Hasher}; use std::mem::MaybeUninit; use std::ops::{Deref, DerefMut}; +#[cfg(feature="std")] use std::path::Path; use std::ptr; use std::slice; @@ -502,6 +503,7 @@ impl fmt::Debug for ArrayString fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { (**self).fmt(f) } } +#[cfg(feature="std")] impl AsRef for ArrayString { fn as_ref(&self) -> &Path { self.as_str().as_ref()