I don't know if this has been comprehensively addressed here... I'd like to sort a
Vec by another
A quick google search leads to this post. But I don't really want to use a whole crate if I can get away with it.
Is there an optimal way to do this? Or an idiomatic one?
// Vec<usize> let order = vec![2, 0, 1, 3, 4]; // Vec<u8> let seq = vec![b'G', b'A', b'C', b'T', b'A']; // ordering magic here... // output // [A, C, G, T, A]