The problem is, I can't overload a function in rust. Even a trait doesn't seem to work, because there is a difference between Vec<Box<T>> and Vec<T>. So do I have to invent a new function name like this?
I could implement this easily in Java or C++, but I have my problems with rust. Any ideas, how I could define just one function name with different parameters?
My code is here, but the boxed variant is missing so far.
I am not sure what the in-place version does. Loos like it permutes and possibly duplicates some elements without changing the vector size. So you need the T: Clone bound (Copy is severely more restricted) and a &mut [T] slice.
Are you referring to passing Vec<T> in as &[T]/&mut [T]? If so, that's handled using deref coercion, which will automagically kick in if you pass &Vec<T> to a function that accepts &[T] (similarly for a mutable reference).
EDIT: And arguably passing slices is much nicer because deref coercion gives you a little bit of free function "overloading" by default.