Skip to content

Commit a4432ca

Browse files
committed
graph: Add Default impls for log serializers
1 parent 687eac4 commit a4432ca

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

graph/src/log/common.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ pub struct SimpleKVSerializer {
99
kvs: Vec<(String, String)>,
1010
}
1111

12+
impl Default for SimpleKVSerializer {
13+
fn default() -> Self {
14+
Self::new()
15+
}
16+
}
17+
1218
impl SimpleKVSerializer {
1319
pub fn new() -> Self {
1420
Self { kvs: Vec::new() }
@@ -39,6 +45,12 @@ pub struct VecKVSerializer {
3945
kvs: Vec<(String, String)>,
4046
}
4147

48+
impl Default for VecKVSerializer {
49+
fn default() -> Self {
50+
Self::new()
51+
}
52+
}
53+
4254
impl VecKVSerializer {
4355
pub fn new() -> Self {
4456
Self { kvs: Vec::new() }
@@ -61,6 +73,12 @@ pub struct HashMapKVSerializer {
6173
kvs: Vec<(String, String)>,
6274
}
6375

76+
impl Default for HashMapKVSerializer {
77+
fn default() -> Self {
78+
Self::new()
79+
}
80+
}
81+
6482
impl HashMapKVSerializer {
6583
pub fn new() -> Self {
6684
HashMapKVSerializer { kvs: Vec::new() }

0 commit comments

Comments
 (0)