fixed clippy warnings
All checks were successful
continuous-integration/woodpecker the build was successful

This commit is contained in:
Thomas Eppers 2021-11-25 17:10:29 +01:00
parent 3bf2359392
commit 6c83683a4a
3 changed files with 3 additions and 10 deletions

View File

@ -54,10 +54,7 @@ impl std::iter::Iterator for State {
impl Ui {
pub fn run(opt: &Opt) {
let repo_id = match &opt.repo {
None => None,
Some(repo) => Some(String::as_str(repo)),
};
let repo_id = opt.repo.as_ref().map(|repo| String::as_str(repo));
let mut ui = Ui {
state: State::SelectService,

View File

@ -49,10 +49,7 @@ pub struct NoYaml {
impl NoYaml {
pub fn run(opt: &Opt) {
let repo_id = match &opt.repo {
None => None,
Some(repo) => Some(String::as_str(repo)),
};
let repo_id = opt.repo.as_ref().map(|repo| String::as_str(repo));
let mut ui = NoYaml {
state: State::EditRepo,

View File

@ -64,11 +64,10 @@ impl RepoEntry {
Key::Backspace => {
if self.default_text {
self.text = String::new();
self.changed = true;
} else {
self.text.pop();
self.changed = true;
}
self.changed = true;
}
Key::Esc => {
self.text = self.old_text.clone();