Fix clippy warnings

This commit is contained in:
Tobias Reisinger 2022-07-17 21:01:32 +02:00
parent e3adc35221
commit 467a98af43
2 changed files with 3 additions and 8 deletions

View file

@ -125,14 +125,9 @@ pub fn set_schedule_tags(schedule: &Schedule, new_tags: &[String]) -> Result<(),
.load::<Tag>(&connection)
.expect("Error loading tags");
let database_tags_str: Vec<String> = database_tags
.iter()
.map(|tag_db| tag_db.tag.clone())
.collect();
// create missing tags
for new_tag in new_tags {
if !database_tags_str.contains(new_tag) {
if !database_tags.iter().any(|tab_db| tab_db.tag.eq(new_tag)) {
database_tags.push(create_tag(new_tag).expect("Error inserting tag"));
}
}