diff options
author | Luca Casonato <hello@lcas.dev> | 2023-10-26 18:39:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-26 18:39:04 +0200 |
commit | 08b99f39093ef8f0363bf943ab6719ed0f9d7b21 (patch) | |
tree | f8db043351b6bc94a189c5f00ed6f606aa330df5 /ext/kv/lib.rs | |
parent | 842e29057d6e545c6b498c584a5366fff34f6aa7 (diff) |
chore: update base64 crate (#20877)
Diffstat (limited to 'ext/kv/lib.rs')
-rw-r--r-- | ext/kv/lib.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/ext/kv/lib.rs b/ext/kv/lib.rs index e99b14552..20f774033 100644 --- a/ext/kv/lib.rs +++ b/ext/kv/lib.rs @@ -12,6 +12,8 @@ use std::cell::RefCell; use std::num::NonZeroU32; use std::rc::Rc; +use base64::prelude::BASE64_URL_SAFE; +use base64::Engine; use chrono::Utc; use codec::decode_key; use codec::encode_key; @@ -543,11 +545,7 @@ fn encode_cursor( if !boundary_key.starts_with(common_prefix) { return Err(type_error("invalid boundary key")); } - - Ok(base64::encode_config( - &boundary_key[common_prefix.len()..], - base64::URL_SAFE, - )) + Ok(BASE64_URL_SAFE.encode(&boundary_key[common_prefix.len()..])) } fn decode_selector_and_cursor( @@ -560,7 +558,8 @@ fn decode_selector_and_cursor( }; let common_prefix = selector.common_prefix(); - let cursor = base64::decode_config(cursor, base64::URL_SAFE) + let cursor = BASE64_URL_SAFE + .decode(cursor) .map_err(|_| type_error("invalid cursor"))?; let first_key: Vec<u8>; |