Skip to main content

luaur_analysis/methods/
stringifier_state_emit_to_string.rs

1use crate::records::stringifier_state::StringifierState;
2
3impl StringifierState {
4    pub fn emit_string(&mut self, s: &str) {
5        if self.opts.is_null() {
6            return;
7        }
8
9        let max_type_length = unsafe { (*self.opts).max_type_length };
10        if max_type_length > 0 {
11            let result_name = unsafe { &(*self.result).name };
12            if result_name.len() > max_type_length as usize {
13                return;
14            }
15        }
16
17        unsafe { (*self.result).name.push_str(s) };
18    }
19}