mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-05-06 07:17:27 +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 {
|
||||
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",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue