Hi, I am a Rust newbie.
Here is my failed code.
#[derive(Clone)]
enum SomeEnum { A, B, }
fn func(vm: &VecMap<SomeEnum>, p: SomeEnum, index: usize) -> VecMap<SomeEnum> {
let mut result = vm.clone();
result.insert(index, p);
result
}
I wanted result as VecMap, but compiler says that vm.clone() is &VecMap.
How can I copy the original from its reference?