pub fn extend_with_last<T>(vec: &mut Vec<T>, new_len: usize)where T: Clone + Default,
Extend the vec with last element