From d4cdb6f9dfd2438ef8fb99b99bf4b085cfb0a7ed Mon Sep 17 00:00:00 2001 From: Josef Reidinger Date: Wed, 19 Jul 2023 13:58:14 +0200 Subject: [PATCH] fix formatting --- rust/agama-cli/src/questions.rs | 2 +- rust/agama-dbus-server/src/questions.rs | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/rust/agama-cli/src/questions.rs b/rust/agama-cli/src/questions.rs index 51bb312321..72aab8d80b 100644 --- a/rust/agama-cli/src/questions.rs +++ b/rust/agama-cli/src/questions.rs @@ -47,7 +47,7 @@ async fn set_mode(value: Modes) -> anyhow::Result<()> { pub async fn run(subcommand: QuestionsCommands) -> anyhow::Result<()> { match subcommand { QuestionsCommands::Mode(value) => set_mode(value.value).await, - QuestionsCommands::Answers { path } => { + QuestionsCommands::Answers { path: _ } => { log::info!("TODO: implement answers"); Ok(()) } diff --git a/rust/agama-dbus-server/src/questions.rs b/rust/agama-dbus-server/src/questions.rs index 79b023f11f..e02fe81de1 100644 --- a/rust/agama-dbus-server/src/questions.rs +++ b/rust/agama-dbus-server/src/questions.rs @@ -81,7 +81,7 @@ enum QuestionType { } /// Trait for objects that can provide answers to all kind of Question. -/// +/// /// If not strategy is used or all defined strategies does not know answer, /// then users need to answer it themself. trait AnswerStrategy { @@ -261,10 +261,8 @@ impl Questions { if !self.interactive() { self.answer_strategies.pop(); } - } else { - if self.interactive() { - self.answer_strategies.push(Box::new(DefaultAnswers {})); - } + } else if self.interactive() { + self.answer_strategies.push(Box::new(DefaultAnswers {})); } }