Returns metadata dimensions based on the fields Note that the base dimensions will be implicitly included as the first item in the returned vector
(
schema: &MetadataSchema,
metadata_fields: Option<&MetadataFields>,
)
| 126 | /// Note that the base dimensions will be implicitly included as the |
| 127 | /// first item in the returned vector |
| 128 | pub fn fields_to_dimensions( |
| 129 | schema: &MetadataSchema, |
| 130 | metadata_fields: Option<&MetadataFields>, |
| 131 | ) -> Result<Vec<MetadataDimensions>, Error> { |
| 132 | let mut result = vec![]; |
| 133 | // First add base dimensions |
| 134 | result.push(schema.base_dimensions()); |
| 135 | |
| 136 | if let Some(fields) = metadata_fields { |
| 137 | let weighted_dims = schema.weighted_dimensions(fields, HIGH_WEIGHT)?; |
| 138 | for wd in weighted_dims.into_iter() { |
| 139 | result.push(wd); |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | Ok(result) |
| 144 | } |
| 145 | |
| 146 | fn gen_combinations(vs: &Vec<Vec<u16>>) -> Vec<Vec<u16>> { |
| 147 | if vs.is_empty() { |
no test coverage detected