remove needless borrows

This commit is contained in:
daniel.eades 2023-11-16 17:27:47 +00:00 committed by Ashley Wulber
parent 94f9879a39
commit 41b88532c9
5 changed files with 9 additions and 9 deletions

View file

@ -47,19 +47,19 @@ impl AppListConfig {
pub fn add_favorite(&mut self, id: String, config: &Config) {
if !self.favorites.contains(&id) {
self.favorites.push(id);
let _ = self.write_entry(&config);
let _ = self.write_entry(config);
}
}
pub fn remove_favorite(&mut self, id: String, config: &Config) {
if let Some(pos) = self.favorites.iter().position(|e| e == &id) {
self.favorites.remove(pos);
let _ = self.write_entry(&config);
let _ = self.write_entry(config);
}
}
pub fn update_favorites(&mut self, favorites: Vec<String>, config: &Config) {
self.favorites = favorites;
let _ = self.write_entry(&config);
let _ = self.write_entry(config);
}
}