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

I am looking at im_rc::vector::Vector - Rust

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!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.