mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-06-01 09:42:41 +00:00
feat: make GameMode::as_str constant
This commit is contained in:
parent
32c267621e
commit
c2f6a68648
1 changed files with 6 additions and 7 deletions
|
|
@ -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",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue