From 6fd36980c8b87e8ec4a295333780233ff37b391f Mon Sep 17 00:00:00 2001 From: appflowy Date: Fri, 8 Jul 2022 08:37:12 +0800 Subject: [PATCH] chore: fix tests --- .../src/entities/filter_entities/select_option_filter.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/rust-lib/flowy-grid/src/entities/filter_entities/select_option_filter.rs b/frontend/rust-lib/flowy-grid/src/entities/filter_entities/select_option_filter.rs index b5b2f5f934..15edec0707 100644 --- a/frontend/rust-lib/flowy-grid/src/entities/filter_entities/select_option_filter.rs +++ b/frontend/rust-lib/flowy-grid/src/entities/filter_entities/select_option_filter.rs @@ -19,13 +19,15 @@ impl GridSelectOptionFilter { let selected_option_ids: Vec<&String> = selected_options.options.iter().map(|option| &option.id).collect(); match self.condition { SelectOptionCondition::OptionIs => { + // if selected options equal to filter's options, then the required_options will be empty. let required_options = self .option_ids .iter() - .filter(|id| selected_option_ids.contains(id)) + .filter(|id| !selected_option_ids.contains(id)) .collect::>(); + // https://stackoverflow.com/questions/69413164/how-to-fix-this-clippy-warning-needless-collect - required_options.is_empty() + !required_options.is_empty() } SelectOptionCondition::OptionIsNot => { for option_id in selected_option_ids {