From 496c0fb69912ab0f3e281101b5025262f81ebc29 Mon Sep 17 00:00:00 2001 From: Laurenz Stampfl Date: Wed, 8 May 2024 23:06:54 +0200 Subject: [PATCH] Fix base64 --- examples/font2svg.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/font2svg.rs b/examples/font2svg.rs index 608cc899..7b3cea9f 100644 --- a/examples/font2svg.rs +++ b/examples/font2svg.rs @@ -1,5 +1,6 @@ use std::io::Write; use std::path::PathBuf; +use base64::engine::general_purpose::STANDARD; use ttf_parser as ttf; use ttf_parser::colr::{ClipBox, Paint}; @@ -174,7 +175,7 @@ fn process(args: Args) -> Result<(), Box> { svg.write_attribute_raw("xlink:href", |buf| { buf.extend_from_slice(b"data:image/png;base64, "); - let mut enc = base64::write::EncoderWriter::new(buf, base64::STANDARD); + let mut enc = base64::write::EncoderWriter::new(buf, &STANDARD); enc.write_all(img.data).unwrap(); enc.finish().unwrap(); }); @@ -188,7 +189,7 @@ fn process(args: Args) -> Result<(), Box> { svg.write_attribute_raw("xlink:href", |buf| { buf.extend_from_slice(b"data:image/svg+xml;base64, "); - let mut enc = base64::write::EncoderWriter::new(buf, base64::STANDARD); + let mut enc = base64::write::EncoderWriter::new(buf, &STANDARD); enc.write_all(img.data).unwrap(); enc.finish().unwrap(); });