()
| 574 | |
| 575 | #[test] |
| 576 | fn get_many_mut() { |
| 577 | let mut m: PrimaryMap<E, usize> = PrimaryMap::new(); |
| 578 | let _0 = m.push(0); |
| 579 | let _1 = m.push(1); |
| 580 | let _2 = m.push(2); |
| 581 | |
| 582 | assert_eq!([&mut 0, &mut 2], m.get_disjoint_mut([_0, _2]).unwrap()); |
| 583 | assert_eq!( |
| 584 | m.get_disjoint_mut([_0, _0]), |
| 585 | Err(slice::GetDisjointMutError::OverlappingIndices) |
| 586 | ); |
| 587 | assert_eq!( |
| 588 | m.get_disjoint_mut([E(4)]), |
| 589 | Err(slice::GetDisjointMutError::IndexOutOfBounds) |
| 590 | ); |
| 591 | } |
| 592 | } |