mirror of
https://github.com/girlbossceo/conduwuit.git
synced 2025-12-14 03:08:57 -05:00
16 lines
373 B
Rust
16 lines
373 B
Rust
|
|
use ::arrayvec::ArrayVec;
|
||
|
|
|
||
|
|
pub trait ArrayVecExt<T> {
|
||
|
|
fn extend_from_slice(&mut self, other: &[T]) -> &mut Self;
|
||
|
|
}
|
||
|
|
|
||
|
|
impl<T: Copy, const CAP: usize> ArrayVecExt<T> for ArrayVec<T, CAP> {
|
||
|
|
#[inline]
|
||
|
|
fn extend_from_slice(&mut self, other: &[T]) -> &mut Self {
|
||
|
|
self.try_extend_from_slice(other)
|
||
|
|
.expect("Insufficient buffer capacity to extend from slice");
|
||
|
|
|
||
|
|
self
|
||
|
|
}
|
||
|
|
}
|