pub struct VecEdit<'a> { base: &'a mut Vec, } impl<'a> VecEdit<'a> { pub fn new(base: &'a mut Vec) -> Self { Self { base } } pub fn base(&'a self) -> &'a Vec { self.base } pub fn add(&mut self, value: i32) { self.base.iter_mut().for_each(|x| *x += value); } }