seen_set 0.1.1

HashSet that doesn't store values.
Documentation
  • Coverage
  • 42.86%
    3 out of 7 items documented0 out of 6 items with examples
  • Size
  • Source code size: 30.48 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.59 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 18s Average build duration of successful builds.
  • all releases: 18s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • dsherret/seen_set
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • dsherret

seen_set

A HashSet that doesn't store values, but instead only stores hashes.

This is useful when you only need to tell if you've seen a value before and you don't want to clone the value for performance reasons.

let mut seen = SeenSet::new();
for path in some_func_that_may_return_duplicate_paths() {
  if !seen.insert(&path) {
    continue;
  }
  // we haven't seen this path before
}

Note: This will be slower for values like numbers. Just use a regular HashSet for that.