refactor multi-get to handle result type

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-10-01 22:37:01 +00:00 committed by strawberry
parent 26dcab272d
commit ab06701ed0
3 changed files with 33 additions and 59 deletions

View file

@ -3,10 +3,6 @@ use serde::Deserialize;
use crate::de;
pub(crate) type OwnedKeyVal = (Vec<u8>, Vec<u8>);
pub(crate) type OwnedKey = Vec<u8>;
pub(crate) type OwnedVal = Vec<u8>;
pub type KeyVal<'a, K = &'a Slice, V = &'a Slice> = (Key<'a, K>, Val<'a, V>);
pub type Key<'a, T = &'a Slice> = T;
pub type Val<'a, T = &'a Slice> = T;
@ -72,10 +68,6 @@ where
de::from_slice::<V>(val)
}
#[inline]
#[must_use]
pub fn to_owned(kv: KeyVal<'_>) -> OwnedKeyVal { (kv.0.to_owned(), kv.1.to_owned()) }
#[inline]
pub fn key<K, V>(kv: KeyVal<'_, K, V>) -> Key<'_, K> { kv.0 }