Filter vector to unique list.
// from
vec![1,1,2,3]
// to
vec![1,2,3]
data
.into_iter()
.collect::<HashSet<_>>()
.into_iter()
.collect::<Vec<_>>()
Cheatsheet collection for go, rust, python, shell and javascript.
Filter vector to unique list.
// from
vec![1,1,2,3]
// to
vec![1,2,3]
data
.into_iter()
.collect::<HashSet<_>>()
.into_iter()
.collect::<Vec<_>>()