Skip to main content

luaur_analysis/functions/
to_string_txn_log.rs

1//! Node: `cxx:Function:Luau.Analysis:Analysis/src/TxnLog.cpp:17:to_string`
2//! Source: `Analysis/src/TxnLog.cpp:15-23` (hand-ported)
3
4use crate::functions::to_string_to_string_alt_f::to_string_type_item;
5use crate::records::pending_type::PendingType;
6use alloc::string::String;
7
8/// C++ `const std::string nullPendingResult = "<nullptr>";` (TxnLog.cpp:15).
9pub const NULL_PENDING_RESULT: &str = "<nullptr>";
10
11/// C++ `std::string toString(PendingType* pending)`.
12pub unsafe fn to_string_pending_type(pending: *mut PendingType) -> String {
13    if pending.is_null() {
14        return String::from(NULL_PENDING_RESULT);
15    }
16
17    to_string_type_item(&(*pending).pending)
18}
19
20#[allow(unused_imports)]
21pub use to_string_pending_type as to_string;