From 42cbd72e3a28308bdf7bc3963e286a25ed04b004 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Tue, 10 Jan 2023 12:47:03 +0100 Subject: [PATCH] chore(deps): Update base64 from 0.20.0 to 0.21.0 --- Cargo.lock | 6 +++--- web/Cargo.toml | 2 +- web/src/storage.rs | 8 ++++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7019f3b08..af63dfc18 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -220,9 +220,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5" +checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" [[package]] name = "bindgen" @@ -3695,7 +3695,7 @@ dependencies = [ name = "ruffle_web" version = "0.1.0" dependencies = [ - "base64 0.20.0", + "base64 0.21.0", "chrono", "console_error_panic_hook", "generational-arena", diff --git a/web/Cargo.toml b/web/Cargo.toml index ce94b56f2..5f7bb4319 100644 --- a/web/Cargo.toml +++ b/web/Cargo.toml @@ -45,7 +45,7 @@ chrono = { version = "0.4", default-features = false, features = ["wasmbind", "c getrandom = { version = "0.2", features = ["js"] } serde = { version = "1.0.152", features = ["derive"] } thiserror = "1.0" -base64 = "0.20.0" +base64 = "0.21.0" [dependencies.ruffle_core] path = "../core" diff --git a/web/src/storage.rs b/web/src/storage.rs index 297a128f3..cd690fa0a 100644 --- a/web/src/storage.rs +++ b/web/src/storage.rs @@ -1,3 +1,5 @@ +use base64::prelude::BASE64_STANDARD; +use base64::Engine; use ruffle_core::backend::storage::StorageBackend; use web_sys::Storage; @@ -14,7 +16,7 @@ impl LocalStorageBackend { impl StorageBackend for LocalStorageBackend { fn get(&self, name: &str) -> Option> { if let Ok(Some(data)) = self.storage.get(name) { - if let Ok(data) = base64::decode(&data) { + if let Ok(data) = BASE64_STANDARD.decode(&data) { return Some(data); } } @@ -23,7 +25,9 @@ impl StorageBackend for LocalStorageBackend { } fn put(&mut self, name: &str, value: &[u8]) -> bool { - self.storage.set(name, &base64::encode(value)).is_ok() + self.storage + .set(name, &BASE64_STANDARD.encode(value)) + .is_ok() } fn remove_key(&mut self, name: &str) {