feat: make GameMode::as_str constant

This commit is contained in:
CosminPerRam 2024-05-01 18:50:05 +03:00
parent 32c267621e
commit c2f6a68648

View file

@ -52,14 +52,13 @@ impl TryFrom<u8> for GameMode {
} }
impl GameMode { impl GameMode {
fn as_str(&self) -> &'static str { const fn as_str(&self) -> &'static str {
use GameMode::*;
match self { match self {
Survival => "survival", Self::Survival => "survival",
Sandbox => "sandbox", Self::Sandbox => "sandbox",
Attack => "attack", Self::Attack => "attack",
PVP => "pvp", Self::PVP => "pvp",
Editor => "editor", Self::Editor => "editor",
} }
} }
} }