aboutsummaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorJonathan Davies <jpds@protonmail.com>2023-01-23 19:14:07 +0000
committerJonathan Davies <jpds@protonmail.com>2023-01-26 11:13:07 +0000
commit36944f1839b27d0c60feadbe15e1d91ad9b74538 (patch)
treef77433869c9615b1f73235913097ea51c862f04c /src/model
parent93c3f8fc8c9d849c26c2eccd551ddf1682e9494f (diff)
downloadgarage-36944f1839b27d0c60feadbe15e1d91ad9b74538.tar.gz
garage-36944f1839b27d0c60feadbe15e1d91ad9b74538.zip
Cargo.toml: Updated base64 from 0.13 to 0.21.
Diffstat (limited to 'src/model')
-rw-r--r--src/model/Cargo.toml2
-rw-r--r--src/model/k2v/causality.rs7
2 files changed, 6 insertions, 3 deletions
diff --git a/src/model/Cargo.toml b/src/model/Cargo.toml
index 3565974f..b47ec195 100644
--- a/src/model/Cargo.toml
+++ b/src/model/Cargo.toml
@@ -25,7 +25,7 @@ arc-swap = "1.0"
blake2 = "0.9"
err-derive = "0.3"
hex = "0.4"
-base64 = "0.13"
+base64 = "0.21"
tracing = "0.1.30"
rand = "0.8"
zstd = { version = "0.12", default-features = false }
diff --git a/src/model/k2v/causality.rs b/src/model/k2v/causality.rs
index 9a692870..62488d53 100644
--- a/src/model/k2v/causality.rs
+++ b/src/model/k2v/causality.rs
@@ -1,3 +1,5 @@
+use base64::prelude::*;
+
use std::collections::BTreeMap;
use std::convert::TryInto;
@@ -41,11 +43,12 @@ impl CausalContext {
bytes.extend(u64::to_be_bytes(i));
}
- base64::encode_config(bytes, base64::URL_SAFE_NO_PAD)
+ BASE64_URL_SAFE_NO_PAD.encode(bytes)
}
/// Parse from base64-encoded binary representation
pub fn parse(s: &str) -> Result<Self, String> {
- let bytes = base64::decode_config(s, base64::URL_SAFE_NO_PAD)
+ let bytes = BASE64_URL_SAFE_NO_PAD
+ .decode(s)
.map_err(|e| format!("bad causality token base64: {}", e))?;
if bytes.len() % 16 != 8 || bytes.len() < 8 {
return Err("bad causality token length".into());