(&self, predicate: impl Fn(&OptionState) -> bool)
| 110 | } |
| 111 | |
| 112 | fn matching_enabled_indices(&self, predicate: impl Fn(&OptionState) -> bool) -> Vec<usize> { |
| 113 | let mut indices: Vec<_> = self |
| 114 | .options |
| 115 | .read() |
| 116 | .iter() |
| 117 | .filter(|option| self.collection.is_available(option.index) && predicate(option)) |
| 118 | .map(|option| option.index) |
| 119 | .collect(); |
| 120 | indices.sort_unstable(); |
| 121 | indices.dedup(); |
| 122 | indices |
| 123 | } |
| 124 | |
| 125 | pub(crate) fn first_matching_enabled_index( |
| 126 | &self, |
no test coverage detected