Vec<T>, &Vec<T> -> ImVec<T>

I am looking at https://docs.rs/im-rc/13.0.0/im_rc/vector/enum.Vector.html

Is there anyway to do Vec<T> -> ImVec<T> or &Vec<T> -> ImVec<T> without calling push_back one by one ?

You can use From<Vec<T>>, From<&'a Vec<T>>, FromIterator<T> or Extend<T>.

1 Like

I missed the From traits – calling .into() on the Vecs solved it. Thanks!