From cb6442c69fc145c05c2c1b8704dad6ce0029ca1e Mon Sep 17 00:00:00 2001 From: hsqStephenZhang Date: Fri, 10 Jan 2025 17:38:34 +0800 Subject: [PATCH 1/3] readme: update no_std notes in readme; ci: add no_std test --- .github/workflows/ci.yml | 2 ++ README.md | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 29a08b9..bf9be65 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -170,6 +170,8 @@ jobs: key: ${{ runner.os }}-coverage-dotcargo - name: Run test run: cargo test + - name: Run test(no_std, hashbrown, libm) + run: cargo test --no-default-features --features hashbrown,libm sanitizer: name: sanitizer diff --git a/README.md b/README.md index b4cbe01..19def8e 100644 --- a/README.md +++ b/README.md @@ -35,10 +35,14 @@ The MSRV for this crate is 1.55.0. [dependencies] caches = "0.2" ``` -- no_std +- no_std (before 0.2.8, it won't compile) + ```toml + # when 0.2.9 is published [dependencies] - caches = {version: "0.2", default-features = false } + caches = {version = "0.2.9", default-features = false , features = ["hashbrown", "libm"]} + # when 0.2.9 is **NOT** published + caches = { git = "https://github.com/al8n/caches-rs.git", branch = "main", default-features = false, features = ["hashbrown", "libm"] } ``` ## Usages From 35b2e428c14d1846b7261458cf4e9563676a9cab Mon Sep 17 00:00:00 2001 From: hsqStephenZhang Date: Fri, 10 Jan 2025 17:38:34 +0800 Subject: [PATCH 2/3] readme: update no_std notes in readme; ci: add no_std test --- .github/workflows/ci.yml | 2 ++ README.md | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 29a08b9..bf9be65 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -170,6 +170,8 @@ jobs: key: ${{ runner.os }}-coverage-dotcargo - name: Run test run: cargo test + - name: Run test(no_std, hashbrown, libm) + run: cargo test --no-default-features --features hashbrown,libm sanitizer: name: sanitizer diff --git a/README.md b/README.md index f8a600d..4f970e7 100644 --- a/README.md +++ b/README.md @@ -41,8 +41,9 @@ The MSRV for this crate is 1.55.0. - no_std ```toml + # when 0.2.9 is published [dependencies] - caches = { version: "0.3", default-features = false, features = ["libm", "hashbrown"] } + caches = { version = "0.3", default-features = false, features = ["libm", "hashbrown"] } ``` ## Usages From b25474657419496a3f99622657086b01d1745e8a Mon Sep 17 00:00:00 2001 From: hsqStephenZhang Date: Fri, 10 Jan 2025 20:33:11 +0800 Subject: [PATCH 3/3] fix: fix hashbrown breaking change in 0.15 --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 517826e..581e1ee 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -135,7 +135,7 @@ mod macros; cfg_not_std!( /// Re-export for DefaultHashBuilder - pub type DefaultHashBuilder = hashbrown::hash_map::DefaultHashBuilder; + pub type DefaultHashBuilder = hashbrown::DefaultHashBuilder; ); cfg_std!(