(
vars_mask: Option<ArrayView<'_, bool, Ix1>>,
)
| 24 | } |
| 25 | |
| 26 | pub fn get_select_info_vars( |
| 27 | vars_mask: Option<ArrayView<'_, bool, Ix1>>, |
| 28 | ) -> anyhow::Result<Vec<SelectInfoElem>> { |
| 29 | // Convert mask to indices |
| 30 | let vars_indices = vars_mask.map(|mask| { |
| 31 | mask.iter() |
| 32 | .enumerate() |
| 33 | .filter_map(|(i, &b)| if b { Some(i) } else { None }) |
| 34 | .collect::<Vec<_>>() |
| 35 | }); |
| 36 | |
| 37 | // Create a selection based on the mask |
| 38 | let mut selection = vec![SelectInfoElem::full(), SelectInfoElem::full()]; |
| 39 | if let Some(vars_idx) = vars_indices { |
| 40 | log!(Level::Debug, "VarIDx length: {}", vars_idx.len()); |
| 41 | selection[1] = SelectInfoElem::Index(vars_idx); |
| 42 | } |
| 43 | |
| 44 | Ok(selection) |
| 45 | } |
| 46 | |
| 47 | #[derive(Debug)] |
| 48 | pub enum FlavorType { |
nothing calls this directly
no outgoing calls
no test coverage detected