Skip to content

Commit 67be79d

Browse files
committed
Bump quickleaf version to 0.2.3 and update valu3 dependency to 0.6.6; refactor Event and EventData types for improved clarity
1 parent 4a3abe5 commit 67be79d

4 files changed

Lines changed: 20 additions & 18 deletions

File tree

Cargo.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "quickleaf"
3-
version = "0.2.2"
3+
version = "0.2.3"
44
edition = "2021"
55
license = "Apache-2.0"
66
authors = ["Philippe Assis <codephilippe@gmail.com>"]
@@ -12,7 +12,7 @@ repository = "https://github.com/lowcarboncode/quickleaf"
1212
readme = "README.md"
1313

1414
[dependencies]
15-
valu3 = "0.6"
15+
valu3 = "0.6.6"
1616

1717
[features]
1818
default = []

src/cache.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub struct Cache {
1717
map: HashMap<Key, Value>,
1818
list: Vec<Key>,
1919
capacity: usize,
20-
sender: Option<Sender<Event<Value>>>,
20+
sender: Option<Sender<Event>>,
2121
_phantom: std::marker::PhantomData<Value>,
2222
}
2323

@@ -38,7 +38,7 @@ impl Cache {
3838
}
3939
}
4040

41-
pub fn with_sender(capacity: usize, sender: Sender<Event<Value>>) -> Self {
41+
pub fn with_sender(capacity: usize, sender: Sender<Event>) -> Self {
4242
Self {
4343
map: HashMap::new(),
4444
list: Vec::new(),
@@ -48,7 +48,7 @@ impl Cache {
4848
}
4949
}
5050

51-
pub fn set_event(&mut self, sender: Sender<Event<Value>>) {
51+
pub fn set_event(&mut self, sender: Sender<Event>) {
5252
self.sender = Some(sender);
5353
}
5454

src/event.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
1+
use valu3::value::Value;
2+
13
use crate::cache::Key;
24

35
#[derive(Clone, Debug, PartialEq)]
4-
pub enum Event<V> {
5-
Insert(EventData<V>),
6-
Remove(EventData<V>),
6+
pub enum Event {
7+
Insert(EventData),
8+
Remove(EventData),
79
Clear,
810
}
911

1012
#[derive(Clone, Debug, PartialEq)]
11-
pub struct EventData<V> {
13+
pub struct EventData {
1214
pub key: Key,
13-
pub value: V,
15+
pub value: Value,
1416
}
1517

16-
impl<V> Event<V> {
17-
pub fn insert(key: Key, value: V) -> Self {
18+
impl Event {
19+
pub fn insert(key: Key, value: Value) -> Self {
1820
Self::Insert(EventData { key, value })
1921
}
2022

21-
pub fn remove(key: Key, value: V) -> Self {
23+
pub fn remove(key: Key, value: Value) -> Self {
2224
Self::Remove(EventData { key, value })
2325
}
2426

0 commit comments

Comments
 (0)