Skip to main content

tuwunel_core/utils/
arrayvec.rs

1use ::arrayvec::ArrayVec;
2
3pub trait ArrayVecExt<T> {
4	fn extend_from_slice(&mut self, other: &[T]) -> &mut Self;
5}
6
7impl<T: Copy, const CAP: usize> ArrayVecExt<T> for ArrayVec<T, CAP> {
8	#[inline]
9	fn extend_from_slice(&mut self, other: &[T]) -> &mut Self {
10		self.try_extend_from_slice(other)
11			.expect("Insufficient buffer capacity to extend from slice");
12
13		self
14	}
15}