luaur_analysis/methods/set_set.rs
1//! Node: `cxx:Method:Luau.Analysis:Analysis/include/Luau/Set.h:29:set_set`
2//! Source: `Analysis/include/Luau/Set.h:29-32` (hand-ported)
3
4use crate::records::set::Set;
5use luaur_common::records::dense_hash_map::DenseHashMap;
6
7impl<T: Clone + core::hash::Hash + PartialEq> Set<T> {
8 /// C++ `explicit Set(const T& empty_key)`.
9 pub fn new(empty_key: T) -> Self {
10 Self {
11 mapping: DenseHashMap::new(empty_key),
12 entry_count: 0,
13 }
14 }
15}