Skip to content

Commit

Permalink
Make unsync OnceMap and LazyMap const-constructible
Browse files Browse the repository at this point in the history
  • Loading branch information
a1phyr committed Nov 15, 2023
1 parent 2a1112d commit 5aa112e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/unsync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl<K, V> OnceMap<K, V> {
}

impl<K, V, S> OnceMap<K, V, S> {
pub fn with_hasher(hash_builder: S) -> Self {
pub const fn with_hasher(hash_builder: S) -> Self {
let map = RefCell::new(HashMap::new());
Self { map, hash_builder }
}
Expand Down Expand Up @@ -469,7 +469,7 @@ impl<K, V, F> LazyMap<K, V, crate::RandomState, F> {
}

impl<K, V, S, F> LazyMap<K, V, S, F> {
pub fn with_hasher(hash_builder: S, f: F) -> Self {
pub const fn with_hasher(hash_builder: S, f: F) -> Self {
Self {
map: OnceMap::with_hasher(hash_builder),
init: f,
Expand Down

0 comments on commit 5aa112e

Please sign in to comment.