Files
gamenight/gamenight-cli/src/domain/owned_games.rs

18 lines
438 B
Rust

use std::{collections::HashMap, fmt::Display};
use crate::domain::game::Game;
#[derive(Clone)]
pub struct OwnedGames(pub HashMap<String, Vec<Game>>);
impl Display for OwnedGames {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
for (k,v) in &self.0 {
write!(f, "{k}:\n")?;
for g in v {
write!(f, "\t{}\n", g.name)?;
}
}
Ok(())
}
}