seen_set

Crates.ioseen_set
lib.rsseen_set
version0.1.1
sourcesrc
created_at2024-07-06 17:21:53.758729
updated_at2024-07-06 18:44:22.383452
descriptionHashSet that doesn't store values.
homepage
repositoryhttps://github.com/dsherret/seen_set
max_upload_size
id1294215
size14,117
David Sherret (dsherret)

documentation

README

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.

Commit count: 5

cargo fmt