Add getter for key/value
This commit is contained in:
parent
78e104706f
commit
e86403978d
1 changed files with 8 additions and 0 deletions
|
@ -17,6 +17,14 @@ impl<K, V> KeyValue<K, V> {
|
||||||
KeyValue { k: k, v: v }
|
KeyValue { k: k, v: v }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn key(&self) -> &K {
|
||||||
|
&self.k
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn value(&self) -> &V {
|
||||||
|
&self.v
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<K, V> Into<(K, V)> for KeyValue<K, V> {
|
impl<K, V> Into<(K, V)> for KeyValue<K, V> {
|
||||||
|
|
Loading…
Reference in a new issue