fn (im_vec: ImVec<u8>) {
let mut y = vec![];
for x in im_vec.iter() {
y.push(*x);
}
The above works, but looks verbose. I would like to try:
im_vec.iter().collect::<Vec<_>>()
but the issue is that it generates Vec<&u8>
instead of a Vec<u8>
What is the cleanest way to do ImVec<u8>
to Vec<u8>
?
EDIT:
ImVec
refers to im-rc::Vector