Adds renaming games functionality

This commit is contained in:
2025-07-12 17:07:33 +02:00
parent 28f7306d57
commit 3f99b68d62
30 changed files with 502 additions and 178 deletions

View File

@@ -0,0 +1,26 @@
use std::fmt::Display;
use gamenight_api_client_rs::models;
use uuid::Uuid;
#[derive(Clone)]
pub struct Game {
pub id: Uuid,
pub name: String
}
impl From<models::Game> for Game {
fn from(game: models::Game) -> Self {
Self {
id: Uuid::parse_str(&game.id).unwrap(),
name: game.name
}
}
}
impl Display for Game {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "Name: {}", self.name)
}
}