diff --git a/.github/workflows/basic.yml b/.github/workflows/basic.yml index 22f5e11..6b1b7fd 100644 --- a/.github/workflows/basic.yml +++ b/.github/workflows/basic.yml @@ -16,17 +16,10 @@ jobs: toolchain: - stable - nightly - profile: - - dev - - release os: - ubuntu-latest - windows-latest - macos-latest - features: - - "" - - "--no-default-features" - - "--all-features" runs-on: ${{matrix.os}} @@ -37,19 +30,27 @@ jobs: with: toolchain: ${{matrix.toolchain}} + - uses: taiki-e/install-action@cargo-hack + - name: Show version run: cargo version + - name: Check + run: cargo hack check -v --feature-powerset --no-dev-deps + - name: Build - run: cargo build --verbose --profile ${{matrix.profile}} ${{matrix.features}} + run: cargo hack build -v --each-feature - name: Run tests - run: cargo test --verbose --profile ${{matrix.profile}} ${{matrix.features}} -- --nocapture + run: cargo hack test -v --each-feature -- --nocapture + + - name: Run tests (release) + run: cargo hack test -v --each-feature --release -- --nocapture - name: Run loom tests env: RUSTFLAGS: "--cfg loom" - run: cargo test --verbose --profile ${{matrix.profile}} ${{matrix.features}} loom -- --nocapture + run: cargo hack test -v --each-feature --release loom -- --nocapture fmt: runs-on: ubuntu-latest diff --git a/.vscode/settings.json b/.vscode/settings.json index 9754e15..a01be9a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,40 +1,44 @@ { - "cSpell.words": [ - "alloc", - "arcstr", - "bstr", - "bstring", - "clippy", - "clonable", - "codecov", - "decr", - "endianness", - "FFFD", - "flexstr", - "gnuabi", - "hipbyt", - "hipstr", - "imstr", - "interoperabilty", - "miri", - "MIRIFLAGS", - "multibyte", - "nonoverlapping", - "powi", - "repr", - "rmatch", - "rmatches", - "rsplit", - "rsplitn", - "rustc", - "serde", - "splitn", - "stddev", - "subslice", - "uninit", - "uppercased", - "Zmiri" - ], - "rust-analyzer.check.features": "all", - "rust-analyzer.cargo.features": "all" -} \ No newline at end of file + "cSpell.words": [ + "alloc", + "arcstr", + "bstr", + "bstring", + "clippy", + "clonable", + "codecov", + "decr", + "endianness", + "FFFD", + "flexstr", + "gnuabi", + "hipbyt", + "hipstr", + "imstr", + "interoperabilty", + "miri", + "MIRIFLAGS", + "multibyte", + "nocapture", + "nonoverlapping", + "powerset", + "powi", + "repr", + "rmatch", + "rmatches", + "rsplit", + "rsplitn", + "rustc", + "RUSTFLAGS", + "serde", + "splitn", + "stddev", + "subslice", + "taiki-e", + "uninit", + "uppercased", + "Zmiri" + ], + "rust-analyzer.check.features": "all", + "rust-analyzer.cargo.features": "all" +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 59d5dee..728bea0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ Notable changes only. +## Unreleased + +### Changed + +- improve feature testing in CI + +### Fixed + +- fix `bstr` feature in `no_std` + ## [0.7.0] - 2025-01-10 ### Added @@ -25,7 +35,7 @@ Notable changes only. - remove `serde_bytes` dependency - remove `sptr` dependency (following provenance API stabilization in Rust 1.84) -## Fixed +### Fixed - compilation with `serde` for non-Windows non-Unix targets, in particular wasm diff --git a/src/string/bstr.rs b/src/string/bstr.rs index 982c6b5..a130b43 100644 --- a/src/string/bstr.rs +++ b/src/string/bstr.rs @@ -1,9 +1,9 @@ //! Bstr support for strings. use alloc::str; +use alloc::string::String; use alloc::vec::Vec; use core::borrow::Borrow; -use std::string::String; use bstr::{BStr, BString};