Skip to content

Commit

Permalink
fix(term): filter categories duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
ymgyt committed May 4, 2024
1 parent 794f65d commit 60ec0f7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions crates/synd_term/src/ui/components/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ impl Filter {
.iter()
.map(|entry| entry.category().clone())
.collect::<HashSet<_>>();
let prev = self.categories.drain(..).collect::<HashSet<_>>();
let mut prev = self.categories.drain(..).collect::<HashSet<_>>();

let mut new_categories = match populate {
Populate::Replace => {
Expand Down Expand Up @@ -299,9 +299,8 @@ impl Filter {
);
}

let mut new_categories = prev.into_iter().collect::<Vec<_>>();
new_categories.extend(new);
new_categories
prev.extend(new);
prev.into_iter().collect::<Vec<_>>()
}
};

Expand Down

0 comments on commit 60ec0f7

Please sign in to comment.