mirror of
https://github.com/timvisee/lazymc.git
synced 2025-05-19 12:50:23 -07:00
Don't use deprecated base64 method
This commit is contained in:
parent
57117b29f3
commit
a3fef88eac
@ -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.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user