Update Rust crate bincode to v2.0.0 #115

Merged
pierre merged 3 commits from renovate/bincode-2.x-lockfile into master 2025-03-10 18:29:01 +00:00
Showing only changes of commit 0cfae95d7e - Show all commits

View File

@ -26,7 +26,7 @@ impl CryptoWrapper {
}
/// Encrypt some data, returning the result as a base64-encoded string
pub fn encrypt<T: Encode + Decode>(&self, data: &T) -> Result<String, Box<dyn Error>> {
pub fn encrypt<Context, T: Encode + Decode<Context>>(&self, data: &T) -> Result<String, Box<dyn Error>> {
let aes_key = Aes256Gcm::new(&self.key);
let nonce_bytes = rand::rng().random::<[u8; NONCE_LEN]>();
@ -41,7 +41,7 @@ impl CryptoWrapper {
}
/// Decrypt some data previously encrypted using the [`CryptoWrapper::encrypt`] method
pub fn decrypt<T: Decode>(&self, input: &str) -> Result<T, Box<dyn Error>> {
pub fn decrypt<Context, T: Decode<Context>>(&self, input: &str) -> Result<T, Box<dyn Error>> {
let bytes = BASE64_STANDARD.decode(input)?;
if bytes.len() < NONCE_LEN {