Skip to content

Commit 6ae60b4

Browse files
save data as byte array
1 parent 8099d09 commit 6ae60b4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

plotly_kaleido/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ impl Kaleido {
146146
dst.set_extension(format);
147147

148148
let image_data = self.convert(plotly_data, format, width, height, scale)?;
149-
let data: Vec<u8> = match format {
150-
"svg" | "eps" => image_data.as_bytes().to_vec(),
151-
_ => general_purpose::STANDARD.decode(image_data).unwrap(),
149+
let data = match format {
150+
"svg" | "eps" => image_data.as_bytes(),
151+
_ => &general_purpose::STANDARD.decode(image_data).unwrap(),
152152
};
153153
let mut file = File::create(dst.as_path())?;
154154
file.write_all(&data)?;

0 commit comments

Comments
 (0)