Skip to content

Commit 7cd4505

Browse files
committed
Use FnOnce and bump chashmap to 2.0.0.
#19
1 parent e1029cf commit 7cd4505

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

chashmap/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "chashmap"
3-
version = "1.2.0"
3+
version = "2.0.0"
44
authors = ["ticki <[email protected]>"]
55
description = "Fast, concurrent hash maps with extensive API."
66
repository = "https://github.com/ticki/tfs"

chashmap/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -752,8 +752,8 @@ impl<K: PartialEq + Hash, V> CHashMap<K, V> {
752752
/// This looks up `key`. If it exists, the reference to its value is passed through closure
753753
/// `update`. If it doesn't exist, the result of closure `insert` is inserted.
754754
pub fn upsert<F, G>(&self, key: K, insert: F, update: G)
755-
where F: Fn() -> V,
756-
G: Fn(&mut V) {
755+
where F: FnOnce() -> V,
756+
G: FnOnce(&mut V) {
757757
// Expand and lock the table. We need to expand to ensure the bounds on the load factor.
758758
let lock = self.table.read();
759759
{
@@ -786,7 +786,7 @@ impl<K: PartialEq + Hash, V> CHashMap<K, V> {
786786
///
787787
/// Note that if `f` returns `None`, the entry of key `key` is removed unconditionally.
788788
pub fn alter<F>(&self, key: K, f: F)
789-
where F: Fn(Option<V>) -> Option<V> {
789+
where F: FnOnce(Option<V>) -> Option<V> {
790790
// Expand and lock the table. We need to expand to ensure the bounds on the load factor.
791791
let lock = self.table.read();
792792
{

mlcr/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mlcr"
3-
version = "0.2.1"
3+
version = "0.2.0"
44
authors = ["ticki <[email protected]>"]
55
description = "An adaptive machine-learning-based cache tracker/replacement policy."
66
repository = "https://github.com/ticki/tfs"

0 commit comments

Comments
 (0)