diff options
author | Alex Auvolat <alex@adnab.me> | 2023-01-03 15:27:36 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2023-01-03 15:27:36 +0100 |
commit | 8d5505514f950dc1ca1249a3385c9913b5b5e8e0 (patch) | |
tree | a74c043fe76deab6cb0919c6f002f0a4e87be19d /src/util/data.rs | |
parent | 426d8784dac0e39879af52d980887d3692fc907c (diff) | |
download | garage-8d5505514f950dc1ca1249a3385c9913b5b5e8e0.tar.gz garage-8d5505514f950dc1ca1249a3385c9913b5b5e8e0.zip |
Make it explicit when using nonversioned encoding
Diffstat (limited to 'src/util/data.rs')
-rw-r--r-- | src/util/data.rs | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/src/util/data.rs b/src/util/data.rs index 7715c2cc..b2a52e25 100644 --- a/src/util/data.rs +++ b/src/util/data.rs @@ -141,21 +141,6 @@ pub fn gen_uuid() -> Uuid { rand::thread_rng().gen::<[u8; 32]>().into() } -// RMP serialization with names of fields and variants - -/// Serialize to MessagePack -pub fn rmp_to_vec_all_named<T>(val: &T) -> Result<Vec<u8>, rmp_serde::encode::Error> -where - T: Serialize + ?Sized, -{ - let mut wr = Vec::with_capacity(128); - let mut se = rmp_serde::Serializer::new(&mut wr) - .with_struct_map() - .with_string_variants(); - val.serialize(&mut se)?; - Ok(wr) -} - /// Serialize to JSON, truncating long result pub fn debug_serialize<T: Serialize>(x: T) -> String { match serde_json::to_string(&x) { |