Clarify about calling `Lua::init_from_ptr()` multiple times

This commit is contained in:
Alex Orlenko 2021-08-17 15:34:34 +01:00
parent 9f02a9ca09
commit 60fd060d47
No known key found for this signature in database
GPG Key ID: 4C150C250863B96D
1 changed files with 3 additions and 0 deletions

View File

@ -381,6 +381,9 @@ impl Lua {
}
/// Constructs a new Lua instance from an existing raw state.
///
/// Once called, a returned Lua state is cached in the registry and can be retrieved
/// by calling this function again.
#[allow(clippy::missing_safety_doc)]
pub unsafe fn init_from_ptr(state: *mut ffi::lua_State) -> Lua {
let maybe_main_state = get_main_state(state);