luaur_analysis/methods/stringifier_state_has_seen.rs
1//! Node: `cxx:Method:Luau.Analysis:Analysis/src/ToString.cpp:191:stringifier_state_has_seen`
2//! Source: `Analysis/src/ToString.cpp:191-199` (hand-ported)
3
4use crate::records::stringifier_state::StringifierState;
5use core::ffi::c_void;
6
7impl StringifierState {
8 /// C++ `bool hasSeen(const void* tv)`.
9 pub fn has_seen(&mut self, tv: *const c_void) -> bool {
10 let ttv = tv as *mut c_void;
11 if self.seen.contains(&ttv) {
12 return true;
13 }
14
15 self.seen.insert(&ttv);
16 false
17 }
18}