Skip to content

Commit 714bd50

Browse files
authored
Merge pull request #34 from jofas/hashbrown
Support for hashbrown collections and `#![no_std]`
2 parents f6fbc60 + d01328f commit 714bd50

File tree

8 files changed

+724
-489
lines changed

8 files changed

+724
-489
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ jobs:
3333
- name: Run test suite
3434
run: |
3535
cd repo
36-
cargo test
36+
cargo test --all-features

CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
44
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html>).
55

66

7+
## [0.3.0]
8+
9+
### Added
10+
11+
* `hashbrown::hash_map` macro
12+
13+
* `hashbrown::hash_map_e` macro
14+
15+
* `hashbrown::hash_set` macro
16+
17+
718
## [0.2.6]
819

920
### Added
@@ -28,6 +39,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2839

2940
* `map` macro
3041

42+
* `map_e` macro
43+
3144
* `set` macro
3245

3346

Cargo.toml

+19
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,33 @@ repository = "https://github.com/jofas/map_macro"
1212

1313
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1414

15+
[features]
16+
default = ["std"]
17+
std = []
18+
hashbrown = []
19+
# feature that allows the docs to link to the hashbrown documentation
20+
__docs = ["dep:hashbrown"]
21+
1522
[dependencies]
23+
hashbrown = { version = "0.14", optional = true }
1624

1725
[dev-dependencies]
26+
hashbrown = "0.14"
1827
criterion = { version = "^0.3.6", features = ["html_reports"] }
1928

2029
[lib]
2130
bench = false
2231

32+
[[test]]
33+
name = "hashbrown"
34+
path = "tests/hashbrown.rs"
35+
test = true
36+
required-features = ["hashbrown"]
37+
2338
[[bench]]
2439
name = "benches"
2540
harness = false
41+
42+
[package.metadata.docs.rs]
43+
all-features = true
44+
rustdoc-args = ["--cfg", "docsrs"]

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
88

99
This crate offers declarative macros for initializing collections from the
10-
[standard library][std].
10+
[standard library][std] and [hashbrown][hashbrown].
1111

12-
This crate has zero dependencies.
12+
This crate has zero dependencies and is `#![no_std]` if you opt-out of
13+
support for the standard library collections.
1314

1415
## Example
1516

@@ -77,3 +78,4 @@ The explicitly typed versions of the macros are indicated by an `_e` suffix.
7778
[type coercion]: https://doc.rust-lang.org/reference/type-coercions.html
7879
[object safe]: https://doc.rust-lang.org/reference/items/traits.html#object-safety
7980
[hash]: https://doc.rust-lang.org/std/hash/trait.Hash.html
81+
[hashbrown]: https://docs.rs/hashbrown/latest/hashbrown/

0 commit comments

Comments
 (0)