Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ All notable changes to this project will be documented in this file.

## Unreleased

### Improvements

* `OnceMap` no longer requires `K: Clone` everywhere.

## [0.6.2] - 2026-01-21

### New features

* Implement `once::OnceMap` to run computation only once and store the results in a hash map.
* `singleflight::Group` now supports custom hashers for keys.

### Improvements

* `singleflight::Group::forget` now accepts any `&Q` where `Q: ?Sized + Hash + Eq` and `K: Borrow<Q>` aligning with standard HashMap's interface.

## [0.6.1] - 2026-01-11
Expand Down
10 changes: 5 additions & 5 deletions mea/src/once/once_map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub struct OnceMap<K, V, S = RandomState> {

impl<K, V, S> Default for OnceMap<K, V, S>
where
K: Eq + Hash + Clone,
K: Eq + Hash,
V: Clone,
S: BuildHasher + Clone + Default,
{
Expand All @@ -47,7 +47,7 @@ where

impl<K, V> OnceMap<K, V, RandomState>
where
K: Eq + Hash + Clone,
K: Eq + Hash,
V: Clone,
{
/// Creates a new OnceMap with the default hasher.
Expand All @@ -67,7 +67,7 @@ where

impl<K, V, S> OnceMap<K, V, S>
where
K: Eq + Hash + Clone,
K: Eq + Hash,
V: Clone,
S: BuildHasher + Clone,
{
Expand Down Expand Up @@ -96,7 +96,7 @@ where
// 1. Get or create the OnceCell.
let cell = {
let mut map = self.map.lock();
map.entry(key.clone())
map.entry(key)
.or_insert_with(|| Arc::new(OnceCell::new()))
.clone()
};
Expand All @@ -121,7 +121,7 @@ where
// 1. Get or create the OnceCell.
let cell = {
let mut map = self.map.lock();
map.entry(key.clone())
map.entry(key)
.or_insert_with(|| Arc::new(OnceCell::new()))
.clone()
};
Expand Down