Swapping ranges of equal sizes can already be done with std::ptr::swap_nonoverlapping. But what about ranges of different sizes within a Vec/slice/etc.? Does such a function exist?
For example:
let mut vector = vec![1, 2, 3, 4, 5, 6, 7, 8, 9];
function_Im_looking_for(&mut vector, 1..=2, 4..=6);
assert_eq(vector, [1, 5, 6, 7, 4, 2, 3, 8, 9]);
_______ ____