forked from Roflin/gamenight
Fixes some Clippy remarks.
This commit is contained in:
@@ -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> {
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user