types 0.1.2

This commit is contained in:
Robin Appelman 2025-04-11 19:03:33 +02:00
commit c7adeef08e
3 changed files with 18 additions and 2 deletions

View file

@ -1,3 +1,4 @@
use std::fmt::Display;
use std::str::FromStr;
pub use steamid_ng::SteamID;
use time::{Date, OffsetDateTime};
@ -297,6 +298,21 @@ impl GameMode {
GameMode::Ultiduo => '2',
}
}
fn as_str(&self) -> &'static str {
match self {
GameMode::Highlander => "9v9",
GameMode::Sixes => "6v6",
GameMode::Fours => "4v4",
GameMode::Ultiduo => "2v2",
}
}
}
impl Display for GameMode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.as_str())
}
}
#[derive(Debug, Clone)]