Skip to main content

luaur_analysis/functions/
to_string_vector_to_string.rs

1//! Node: `cxx:Function:Luau.Analysis:Analysis/src/ToString.cpp:1934:to_string_vector`
2//! Source: `Analysis/src/ToString.cpp:1934-1944` (hand-ported)
3
4use crate::records::to_string_options::ToStringOptions;
5use crate::type_aliases::type_id::TypeId;
6use alloc::string::String;
7use alloc::vec::Vec;
8
9/// C++ `std::string toStringVector(const std::vector<TypeId>& types, ToStringOptions& opts)`.
10pub fn to_string_vector_vector_type_id_to_string_options(
11    types: &Vec<TypeId>,
12    opts: &mut ToStringOptions,
13) -> String {
14    let mut s = String::new();
15    for &ty in types.iter() {
16        if !s.is_empty() {
17            s.push_str(", ");
18        }
19        s.push_str(
20            &crate::functions::to_string_to_string_alt_m::to_string_type_id_to_string_options(
21                ty, opts,
22            ),
23        );
24    }
25    s
26}