Fill BtreeSet with range corresponding to Vec len

How can I do this:

let v=vec![0,1,2,3];
let mut s=BTreeSet::new();
//here I want to fill btreeset with indexes of vec
//I've tried, but no luck

Thank you

You do it like this:

let v = vec![0, 1, 2, 3];
let mut s = BTreeSet::new();


1 Like

Almost... :wink:

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.