Skip to content

Commit

Permalink
Merge pull request #34 from jofas/hashbrown
Browse files Browse the repository at this point in the history
Support for hashbrown collections and `#![no_std]`
  • Loading branch information
jofas authored Jan 28, 2024
2 parents f6fbc60 + d01328f commit 714bd50
Show file tree
Hide file tree
Showing 8 changed files with 724 additions and 489 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
- name: Run test suite
run: |
cd repo
cargo test
cargo test --all-features
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html>).


## [0.3.0]

### Added

* `hashbrown::hash_map` macro

* `hashbrown::hash_map_e` macro

* `hashbrown::hash_set` macro


## [0.2.6]

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

* `map` macro

* `map_e` macro

* `set` macro


Expand Down
19 changes: 19 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,33 @@ repository = "https://github.com/jofas/map_macro"

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

[features]
default = ["std"]
std = []
hashbrown = []
# feature that allows the docs to link to the hashbrown documentation
__docs = ["dep:hashbrown"]

[dependencies]
hashbrown = { version = "0.14", optional = true }

[dev-dependencies]
hashbrown = "0.14"
criterion = { version = "^0.3.6", features = ["html_reports"] }

[lib]
bench = false

[[test]]
name = "hashbrown"
path = "tests/hashbrown.rs"
test = true
required-features = ["hashbrown"]

[[bench]]
name = "benches"
harness = false

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

This crate offers declarative macros for initializing collections from the
[standard library][std].
[standard library][std] and [hashbrown][hashbrown].

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

## Example

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

0 comments on commit 714bd50

Please sign in to comment.