Function gut::utils::slice::apply_permutation [−][src]
Expand description
Apply a given permutation
of indices to the given array
of values in place.
Example
use meshx::utils::slice::apply_permutation;
let perm = vec![7, 8, 2, 3, 4, 1, 6, 5, 0];
let mut values = String::from("tightsemi");
// SAFETY: we are just permuting ASCII chars here for demonstrative purposes.
apply_permutation(&perm, unsafe { values.as_bytes_mut() });
assert_eq!(values, "mightiest");