Skip to content

Commit

Permalink
update implementation to work with new base64 crate version
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Gherghescu <[email protected]>
  • Loading branch information
andrei-ng committed May 1, 2024
1 parent dc4e7b4 commit 0b86727
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plotly_kaleido/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -168,7 +169,7 @@ impl Kaleido {
if let Some(image_data) = res.result {
let data: Vec<u8> = 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)?;
Expand Down

0 comments on commit 0b86727

Please sign in to comment.