Skip to content

Commit

Permalink
apply clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Jul 17, 2023
1 parent 071ebd6 commit cd79884
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions rust/agama-dbus-server/src/questions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ struct DefaultAnswers;

impl AnswerStrategy for DefaultAnswers {
fn answer(&self, question: &GenericQuestion) -> Option<String> {
return Some(question.default_option.clone());
Some(question.default_option.clone())
}

fn answer_with_password(&self, question: &WithPassword) -> (Option<String>, Option<String>) {
return (Some(question.base.default_option.clone()), None);
(Some(question.base.default_option.clone()), None)
}
}

Expand Down Expand Up @@ -252,13 +252,13 @@ impl Questions {
/// What happens underhood is that it user answer_strategies vector
/// and try to find the first strategy that provides answer. When
/// aswer is provided, it returns immediatelly.
fn fill_answer(&self, question: &mut GenericQuestion) -> () {
fn fill_answer(&self, question: &mut GenericQuestion) {
for strategy in self.answer_strategies.iter() {
match strategy.answer(question) {
None => (),
Some(answer) => {
question.answer = answer;
return ();
return ;
}
}
}
Expand All @@ -269,15 +269,15 @@ impl Questions {
/// What happens underhood is that it user answer_strategies vector
/// and try to find the first strategy that provides answer. When
/// aswer is provided, it returns immediatelly.
fn fill_answer_with_password(&self, question: &mut WithPassword) -> () {
fn fill_answer_with_password(&self, question: &mut WithPassword) {
for strategy in self.answer_strategies.iter() {
let (answer, password) = strategy.answer_with_password(question);
if let Some(password) = password {
question.password = password;
}
if let Some(answer) = answer {
question.base.answer = answer;
return ();
return ;
}
}
}
Expand Down

0 comments on commit cd79884

Please sign in to comment.