From 0b867274aa51632dce288cf52ff9c1d0b7baa5a2 Mon Sep 17 00:00:00 2001 From: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com> Date: Wed, 1 May 2024 10:53:20 +0200 Subject: [PATCH] update implementation to work with new base64 crate version Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com> --- plotly_kaleido/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plotly_kaleido/src/lib.rs b/plotly_kaleido/src/lib.rs index 73d5d9b8..f4df4358 100644 --- a/plotly_kaleido/src/lib.rs +++ b/plotly_kaleido/src/lib.rs @@ -16,6 +16,7 @@ use std::io::BufReader; use std::path::{Path, PathBuf}; use std::process::{Command, Stdio}; +use base64::{engine::general_purpose, Engine as _}; use directories::ProjectDirs; use serde::{Deserialize, Serialize}; use serde_json::Value; @@ -168,7 +169,7 @@ impl Kaleido { if let Some(image_data) = res.result { let data: Vec = match format { "svg" | "eps" => image_data.as_bytes().to_vec(), - _ => base64::decode(image_data).unwrap(), + _ => general_purpose::STANDARD.decode(image_data).unwrap(), }; let mut file = File::create(dst.as_path())?; file.write_all(&data)?;