Skip to content

Commit

Permalink
optimize interface
Browse files Browse the repository at this point in the history
  • Loading branch information
SF-Zhou committed Dec 27, 2024
1 parent 3a685b8 commit ac35c51
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 202 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lockmap"
version = "0.1.2"
version = "0.1.3"
edition = "2021"

authors = ["SF-Zhou <sfzhou.scut@gmail.com>"]
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ let map = LockMap::<String, String>::new();
map.set_by_ref("key", "value".into());

// Get a value
assert_eq!(map.get_by_ref("key"), Some("value".into()));
assert_eq!(map.get("key"), Some("value".into()));

// Use entry API for exclusive access
{
Expand All @@ -28,5 +28,5 @@ assert_eq!(map.get_by_ref("key"), Some("value".into()));
}

// Remove a value
map.remove_by_ref("key");
map.remove("key");
```
Loading

0 comments on commit ac35c51

Please sign in to comment.