Skip to main content

One post tagged with "deduplicate"

View All Tags

Deduplicate elements in Vec in Rust

· One min read
forfd8960
Author

How to Deduplicate the elements in a Vector

First Version

in the first version of the deduplicate:

  • First create data_set to matain the data exists state.
  • Iter over the data and check if the specific data in idx is exists
  • If exists then skip.
  • If not exists then push the data to new result: dedup_data.