KE65WRE5E2R5BDPKZDEATOR7A7UY3S3S2GWICZQ5BQ5PRSE7RFVAC
impl Display for Card {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(1) = f.precision() {
match self {
Self::Jack => f.pad("J")?,
Self::Queen => f.pad("Q")?,
Self::King => f.pad("K")?,
_ => f.write_fmt(format_args!("{}", self.into_usize() + 1))?,
};
} else {
f.write_fmt(format_args!("{:?}", self))?;
}
Ok(())
}
}
impl Display for Player {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(precision) = f.precision() {
if precision < 6 {
match self {
Self::Chance => f.pad("Ch")?,
_ => f.write_fmt(format_args!("A{}", self.into_usize()))?,
};
}
} else {
f.write_fmt(format_args!("{:?}", self))?;
}
Ok(())
}
}