(values: Vec<Value>)
| 5481 | } |
| 5482 | |
| 5483 | fn booted_first(values: Vec<Value>) -> Vec<Value> { |
| 5484 | let mut indexed_values = values.into_iter().enumerate().collect::<Vec<_>>(); |
| 5485 | indexed_values.sort_by(|(left_index, left), (right_index, right)| { |
| 5486 | let left_booted = left |
| 5487 | .get("isBooted") |
| 5488 | .and_then(Value::as_bool) |
| 5489 | .unwrap_or(false); |
| 5490 | let right_booted = right |
| 5491 | .get("isBooted") |
| 5492 | .and_then(Value::as_bool) |
| 5493 | .unwrap_or(false); |
| 5494 | right_booted |
| 5495 | .cmp(&left_booted) |
| 5496 | .then_with(|| left_index.cmp(right_index)) |
| 5497 | }); |
| 5498 | indexed_values.into_iter().map(|(_, value)| value).collect() |
| 5499 | } |
| 5500 | |
| 5501 | async fn list_simulators_cached( |
| 5502 | state: AppState, |
no test coverage detected