Newer
Older
use rand::{distributions::Alphanumeric, Rng};
pub fn vec_to_set<T: Clone + Eq + std::hash::Hash>(data: &[T]) -> HashSet<T> {
HashSet::from_iter(data.iter().cloned())
}
This instance is read-only!
Currently restored from a November 2023 backup, read the 2023 data loss notice here or visit the new GitLab instance here.
use rand::{distributions::Alphanumeric, Rng};
pub fn vec_to_set<T: Clone + Eq + std::hash::Hash>(data: &[T]) -> HashSet<T> {
HashSet::from_iter(data.iter().cloned())
}