luaur-common 0.1.3

Foundational data structures and flags for the luaur Luau-in-Rust toolchain.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Port of `Luau::vformat` from `Common/src/StringUtils.cpp`.
//!
//! See [`crate::functions::vformat_append`] for the documented deviation: the
//! C++ `std::string vformat(const char* fmt, va_list args)` becomes a
//! `core::fmt::Arguments` consumer so the port stays on stable + `wasm32`.

use alloc::string::String;

use crate::functions::vformat_append::vformatAppend;

#[allow(non_snake_case)]
pub fn vformat(args: core::fmt::Arguments<'_>) -> String {
    let mut ret = String::new();
    vformatAppend(&mut ret, args);
    ret
}