Fix compilation error

This commit is contained in:
timvisee
2021-11-25 13:27:44 +01:00
parent d39ad9c913
commit 084c3c5f8b

View File

@@ -1,7 +1,7 @@
use crate::proto::client::ClientInfo;
/// Protocol version since when favicons are supported.
const FAVICON_PROTOCOL_VERSION: i32 = 4;
const FAVICON_PROTOCOL_VERSION: u32 = 4;
/// Get default server status favicon.
pub fn default_favicon() -> String {
@@ -20,7 +20,7 @@ pub fn encode_favicon(data: &[u8]) -> String {
/// Defaults to `true` if unsure.
pub fn supports_favicon(client_info: &ClientInfo) -> bool {
client_info
.protocol_version
.protocol
.map(|p| p >= FAVICON_PROTOCOL_VERSION)
.unwrap_or(true)
}