#[cold]
#[inline(never)]
fn assert_failed(index: usize, len: usize) -> ! {
- panic!(
- "swap_remove index (is {index}) should be < len (is {len})"
- );
+ panic!("swap_remove index (is {index}) should be < len (is {len})");
}
let len = self.len();
#[cold]
#[inline(never)]
fn assert_failed(index: usize, len: usize) -> ! {
- panic!(
- "insertion index (is {index}) should be <= len (is {len})"
- );
+ panic!("insertion index (is {index}) should be <= len (is {len})");
}
let len = self.len();
}
}
+impl<T, const CAP: usize> Clone for FixedVec<T, CAP>
+where
+ T: Clone,
+{
+ fn clone(&self) -> Self {
+ let mut v = Self::new();
+ for i in self {
+ v.push(i.clone())
+ }
+ v
+ }
+}
+
impl<T: PartialEq, const CAP: usize> FixedVec<T, CAP> {
#[inline]
pub fn dedup(&mut self) {