luaur-analysis 0.1.3

Luau type checker and type inference (Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::records::constraint_list::ConstraintList;
use crate::type_aliases::constraint_vertex::ConstraintVertex;

impl ConstraintList {
    pub fn insert(&mut self, vertex: ConstraintVertex) {
        let (entry, fresh) = self.present.try_insert(vertex.clone(), true);
        if fresh {
            self.order.push(vertex);
            self.entries += 1;
        } else if !*entry {
            *entry = true;
            self.entries += 1;
        }
        // If the entry was *not* fresh and its value was already true, then do
        // nothing: the set state has not changed.
    }
}