(
tags: &HashMap<String, String>,
s: &pbjson_types::Struct,
)
| 351 | } |
| 352 | |
| 353 | fn struct_to_measurements( |
| 354 | tags: &HashMap<String, String>, |
| 355 | s: &pbjson_types::Struct, |
| 356 | ) -> Vec<Measurement> { |
| 357 | let mut out: Vec<Measurement> = Vec::new(); |
| 358 | |
| 359 | out.append(&mut struct_values_to_location( |
| 360 | tags, |
| 361 | "device_frmpayload_data", |
| 362 | &s.fields, |
| 363 | )); |
| 364 | |
| 365 | for (k, v) in &s.fields { |
| 366 | if k == "latitude" || k == "longitude" { |
| 367 | continue; |
| 368 | } |
| 369 | out.append(&mut struct_value_to_measurements( |
| 370 | tags, |
| 371 | &format!("device_frmpayload_data_{}", k), |
| 372 | v, |
| 373 | )) |
| 374 | } |
| 375 | |
| 376 | out |
| 377 | } |
| 378 | |
| 379 | fn struct_values_to_location( |
| 380 | tags: &HashMap<String, String>, |
no test coverage detected