| 1 | #[inline] |
| 2 | pub(craterust-analyzer cargo handlebars 5.1.2 crate/) fn copy_on_push_vecrust-analyzer cargo handlebars 5.1.2 util/copy_on_push_vec().<T>(input: &[T], el: T) -> Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<T> |
| 3 | where |
| 4 | T: Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone#, |
| 5 | { |
| 6 | let mut new_vec = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::with_capacityrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]with_capacity().(input.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().1); |
| 7 | new_vec.extend_from_slicerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]extend_from_slice().(input); |
| 8 | new_vec.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(el); |
| 9 | new_vec |
| 10 | } |
| 11 | |
| 12 | #[inline] |
| 13 | pub(craterust-analyzer cargo handlebars 5.1.2 crate/) fn extendrust-analyzer cargo handlebars 5.1.2 util/extend().(base: &mut Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>, slice: &[Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#]) { |
| 14 | for i in slice { |
| 15 | base.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(i.to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/impl#[T][ToOwned]to_owned().()); |
| 16 | } |
| 17 | } |