From 50e026f8598293660ff763e8bec9437b4aad02fd Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Fri, 25 Feb 2022 16:53:17 +0000 Subject: [PATCH] Remove unused datastore key --- lib/src/key/kv.rs | 52 ---------------------------------------------- lib/src/key/mod.rs | 1 - 2 files changed, 53 deletions(-) delete mode 100644 lib/src/key/kv.rs diff --git a/lib/src/key/kv.rs b/lib/src/key/kv.rs deleted file mode 100644 index 8a3fefc4..00000000 --- a/lib/src/key/kv.rs +++ /dev/null @@ -1,52 +0,0 @@ -use crate::err::Error; -use crate::key::bytes::{deserialize, serialize}; -use crate::key::BASE; -use serde::{Deserialize, Serialize}; - -#[derive(Debug, PartialEq, PartialOrd, Serialize, Deserialize)] -pub struct Kv { - kv: String, -} - -impl Into> for Kv { - fn into(self) -> Vec { - self.encode().unwrap() - } -} - -impl From> for Kv { - fn from(val: Vec) -> Self { - Kv::decode(&val).unwrap() - } -} - -pub fn new() -> Kv { - Kv::new() -} - -impl Kv { - pub fn new() -> Kv { - Kv { - kv: BASE.to_owned(), - } - } - pub fn encode(&self) -> Result, Error> { - Ok(serialize(self)?) - } - pub fn decode(v: &[u8]) -> Result { - Ok(deserialize(v)?) - } -} - -#[cfg(test)] -mod tests { - #[test] - fn key() { - use super::*; - #[rustfmt::skip] - let val = Kv::new(); - let enc = Kv::encode(&val).unwrap(); - let dec = Kv::decode(&enc).unwrap(); - assert_eq!(val, dec); - } -} diff --git a/lib/src/key/mod.rs b/lib/src/key/mod.rs index 3a8cca77..ecfb1a53 100644 --- a/lib/src/key/mod.rs +++ b/lib/src/key/mod.rs @@ -11,7 +11,6 @@ pub mod ft; pub mod index; pub mod ix; pub mod key; -pub mod kv; pub mod lv; pub mod namespace; pub mod nl;