(&mut self, sli: &[A::Item])
| 464 | /// * If the `ArrayVec` would overflow, this will panic. |
| 465 | #[inline] |
| 466 | pub fn extend_from_slice(&mut self, sli: &[A::Item]) |
| 467 | where |
| 468 | A::Item: Clone, |
| 469 | { |
| 470 | if sli.is_empty() { |
| 471 | return; |
| 472 | } |
| 473 | |
| 474 | let new_len = self.len as usize + sli.len(); |
| 475 | assert!( |
| 476 | new_len <= A::CAPACITY, |
| 477 | "ArrayVec::extend_from_slice> total length {} exceeds capacity {}!", |
| 478 | new_len, |
| 479 | A::CAPACITY |
| 480 | ); |
| 481 | |
| 482 | let target = &mut self.data.as_slice_mut()[self.len as usize..new_len]; |
| 483 | target.clone_from_slice(sli); |
| 484 | self.set_len(new_len); |
| 485 | } |
| 486 | |
| 487 | /// Fill the vector until its capacity has been reached. |
| 488 | /// |
nothing calls this directly
no test coverage detected