Don't use deprecated base64 method

This commit is contained in:
timvisee 2023-01-30 17:42:02 +01:00
parent 57117b29f3
commit a3fef88eac
No known key found for this signature in database
GPG Key ID: B8DB720BC383E172

View File

@ -1,3 +1,5 @@
use base64::Engine;
use crate::proto::client::ClientInfo; use crate::proto::client::ClientInfo;
/// Protocol version since when favicons are supported. /// Protocol version since when favicons are supported.
@ -12,7 +14,11 @@ pub fn default_favicon() -> String {
/// ///
/// This assumes the favicon data to be a valid PNG image. /// This assumes the favicon data to be a valid PNG image.
pub fn encode_favicon(data: &[u8]) -> String { pub fn encode_favicon(data: &[u8]) -> String {
format!("{}{}", "data:image/png;base64,", base64::encode(data)) format!(
"{}{}",
"data:image/png;base64,",
base64::engine::general_purpose::STANDARD.encode(data)
)
} }
/// Check whether the status response favicon is supported based on the given client info. /// Check whether the status response favicon is supported based on the given client info.