Display set counts in player info

This commit is contained in:
Kiana Sheibani 2023-11-27 01:05:58 -05:00
parent db85674601
commit 14b5b2cafd
Signed by: toki
GPG key ID: 6CB106C25E86A9F7
5 changed files with 44 additions and 5 deletions

View file

@ -14,6 +14,15 @@ pub enum StringOrInt {
Int(u64),
}
impl StringOrInt {
pub fn from_string(s: &str) -> Self {
match s.parse::<u64>() {
Ok(x) => StringOrInt::Int(x),
Err(_) => StringOrInt::String(s.to_owned()),
}
}
}
impl Display for StringOrInt {
fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error> {
match self {