Fixes some Clippy remarks.

This commit is contained in:
Dennis Brentjes
2025-05-19 21:01:38 +02:00
parent c994321576
commit 3f7ed03973
5 changed files with 30 additions and 18 deletions

View File

@@ -15,11 +15,17 @@ impl Main {
main_menu.menu.push(Box::new(Exit::new()));
Self {
login: Box::new(Login::new()),
main_menu: main_menu
main_menu
}
}
}
impl Default for Main {
fn default() -> Self {
Self::new()
}
}
#[async_trait]
impl<'a> Flow<'a> for Main {
async fn run(&self, state: &'a mut GamenightState) -> FlowResult<'a> {

View File

@@ -26,6 +26,12 @@ impl GamenightState {
}
}
impl Default for GamenightState {
fn default() -> Self {
Self::new()
}
}
#[derive(Debug)]
pub struct FlowError {
pub error: String
@@ -85,7 +91,7 @@ async fn handle_choice<'a>(choice: &Box<dyn Flow<'a> + Send>, flow: &dyn Flow<'a
async fn handle_choice_option<'a>(choice: &Option<Box<dyn Flow<'a> + Send>>, flow: &dyn Flow<'a>, state: &'a mut GamenightState) -> FlowResult<'a> {
if let Some(choice) = choice {
handle_choice(&choice, flow, state).await
handle_choice(choice, flow, state).await
}
else {
Ok((FlowOutcome::Abort, state))