use std::fmt::Display; use async_trait::async_trait; use uuid::Uuid; use super::{Flow, FlowOutcome, FlowResult, GamenightState}; #[derive(Clone)] pub struct Disown { game_id: Uuid } impl Disown { pub fn new(game_id: Uuid) -> Self { Self { game_id } } } #[async_trait] impl<'a> Flow<'a> for Disown { async fn run(&self, state: &'a mut GamenightState) -> FlowResult<'a> { let _ = state.api.delete_game_owner(&self.game_id.to_string(), &state.get_user_id()?.to_string()).await?; clear_screen::clear(); Ok((FlowOutcome::Successful, state)) } } impl Display for Disown { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "Disown") } }