diff options
author | Alex Auvolat <alex@adnab.me> | 2023-05-16 18:40:27 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2023-05-16 19:46:57 +0200 |
commit | 16f2a32bb78cdc0d9cee9806c04065af845d0dff (patch) | |
tree | c9664138a33fd046eae926de985ec3f4cd54b5d4 | |
parent | 472444ed8ec63200045ff2d366f8b11d1745475f (diff) | |
download | garage-k2v-client-fixes.tar.gz garage-k2v-client-fixes.zip |
cargo fmtk2v-client-fixes
-rw-r--r-- | src/k2v-client/bin/k2v-cli.rs | 4 | ||||
-rw-r--r-- | src/k2v-client/lib.rs | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/k2v-client/bin/k2v-cli.rs b/src/k2v-client/bin/k2v-cli.rs index 5dad6106..e771fe26 100644 --- a/src/k2v-client/bin/k2v-cli.rs +++ b/src/k2v-client/bin/k2v-cli.rs @@ -157,7 +157,9 @@ impl Value { if let Some(ref text) = self.text { Ok(text.as_bytes().to_vec()) } else if let Some(ref b64) = self.b64 { - BASE64_STANDARD.decode(b64).map_err(|_| Error::Message("invalid base64 input".into())) + BASE64_STANDARD + .decode(b64) + .map_err(|_| Error::Message("invalid base64 input".into())) } else if let Some(ref path) = self.file { use tokio::io::AsyncReadExt; if path == "-" { diff --git a/src/k2v-client/lib.rs b/src/k2v-client/lib.rs index 548838f8..3d1b5461 100644 --- a/src/k2v-client/lib.rs +++ b/src/k2v-client/lib.rs @@ -483,9 +483,11 @@ impl<'de> Deserialize<'de> for K2vValue { { let val: Option<&str> = Option::deserialize(d)?; Ok(match val { - Some(s) => { - K2vValue::Value(BASE64_STANDARD.decode(s).map_err(|_| DeError::custom("invalid base64"))?) - } + Some(s) => K2vValue::Value( + BASE64_STANDARD + .decode(s) + .map_err(|_| DeError::custom("invalid base64"))?, + ), None => K2vValue::Tombstone, }) } |