| 1 | #[inline] |
| 2 | pub(crate) fn copy_on_push_vec<T>(input: &[T], el: T) -> Vec<T> |
| 3 | where |
| 4 | T: Clone, |
| 5 | { |
| 6 | let mut new_vec = Vec::with_capacity(input.len() + 1); |
| 7 | new_vec.extend_from_slice(input); |
| 8 | new_vec.push(el); |
| 9 | new_vec |
| 10 | } |
| 11 | |
| 12 | #[inline] |
| 13 | pub(crate) fn extend(base: &mut Vec<String>, slice: &[String]) { |
| 14 | for i in slice { |
| 15 | base.push(i.to_owned()); |
| 16 | } |
| 17 | } |