Make clippy happy with Rust 1.60

This commit is contained in:
Martin Frost 2022-05-16 13:31:00 +02:00
parent a5e35b546f
commit 0859cf6b11
1 changed files with 13 additions and 15 deletions

View File

@ -20,24 +20,22 @@ fn main() {
let opt = Opt::parse(); let opt = Opt::parse();
let mut authors = get_available_coauthors(); let mut authors = get_available_coauthors();
let mut updated_author: Author;
if let Some(author) = authors.get(&opt.initials) { if let Some(author) = authors.get(&opt.initials) {
updated_author = author.clone(); let mut updated_author: Author = author.clone();
if let Some(name) = opt.name {
updated_author.name = name;
};
if let Some(email) = opt.email {
updated_author.email = email;
};
authors.insert(opt.initials, updated_author);
write_coauthors_file(authors);
} else { } else {
eprintln!("No author found with initials {}", &opt.initials); eprintln!("No author found with initials {}", &opt.initials);
process::exit(1); process::exit(1);
} };
if let Some(name) = opt.name {
updated_author.name = name;
}
if let Some(email) = opt.email {
updated_author.email = email;
}
authors.insert(opt.initials, updated_author);
write_coauthors_file(authors);
} }