diff options
author | Jonathan Davies <jpds@protonmail.com> | 2023-01-23 19:14:07 +0000 |
---|---|---|
committer | Jonathan Davies <jpds@protonmail.com> | 2023-01-26 11:13:07 +0000 |
commit | 36944f1839b27d0c60feadbe15e1d91ad9b74538 (patch) | |
tree | f77433869c9615b1f73235913097ea51c862f04c /src/api/k2v/batch.rs | |
parent | 93c3f8fc8c9d849c26c2eccd551ddf1682e9494f (diff) | |
download | garage-36944f1839b27d0c60feadbe15e1d91ad9b74538.tar.gz garage-36944f1839b27d0c60feadbe15e1d91ad9b74538.zip |
Cargo.toml: Updated base64 from 0.13 to 0.21.
Diffstat (limited to 'src/api/k2v/batch.rs')
-rw-r--r-- | src/api/k2v/batch.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/api/k2v/batch.rs b/src/api/k2v/batch.rs index 78035362..82b4f7e3 100644 --- a/src/api/k2v/batch.rs +++ b/src/api/k2v/batch.rs @@ -1,5 +1,6 @@ use std::sync::Arc; +use base64::prelude::*; use hyper::{Body, Request, Response, StatusCode}; use serde::{Deserialize, Serialize}; @@ -31,9 +32,11 @@ pub async fn handle_insert_batch( .transpose() .ok_or_bad_request("Invalid causality token")?; let v = match it.v { - Some(vs) => { - DvvsValue::Value(base64::decode(vs).ok_or_bad_request("Invalid base64 value")?) - } + Some(vs) => DvvsValue::Value( + BASE64_STANDARD + .decode(vs) + .ok_or_bad_request("Invalid base64 value")?, + ), None => DvvsValue::Deleted, }; items2.push((it.pk, it.sk, ct, v)); @@ -322,7 +325,7 @@ impl ReadBatchResponseItem { .values() .iter() .map(|v| match v { - DvvsValue::Value(x) => Some(base64::encode(x)), + DvvsValue::Value(x) => Some(BASE64_STANDARD.encode(x)), DvvsValue::Deleted => None, }) .collect::<Vec<_>>(); |