(items: &mut Vec<CollectionItemState>, item: CollectionItemState)
| 611 | } |
| 612 | |
| 613 | fn sync_item(items: &mut Vec<CollectionItemState>, item: CollectionItemState) { |
| 614 | if let Some(position) = items |
| 615 | .iter() |
| 616 | .position(|existing| existing.same_identity(&item)) |
| 617 | { |
| 618 | items.remove(position); |
| 619 | } |
| 620 | let insert_at = items.partition_point(|existing| existing.index <= item.index); |
| 621 | items.insert(insert_at, item); |
| 622 | } |
| 623 | |
| 624 | fn next_index_after(indices: &[usize], current: Option<usize>, roving_loop: bool) -> Option<usize> { |
| 625 | match current { |
no test coverage detected