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 {
fn as_str(&self) -> &'static str {
use GameMode::*;
const fn as_str(&self) -> &'static str {
match self {
Survival => "survival",
Sandbox => "sandbox",
Attack => "attack",
PVP => "pvp",
Editor => "editor",
Self::Survival => "survival",
Self::Sandbox => "sandbox",
Self::Attack => "attack",
Self::PVP => "pvp",
Self::Editor => "editor",
}
}
}