Skip to content

Commit 7f1d716

Browse files
committed
Remove deprecated Lua::load_from_function
1 parent be56e22 commit 7f1d716

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

src/state.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -549,31 +549,6 @@ impl Lua {
549549
Ok(())
550550
}
551551

552-
#[doc(hidden)]
553-
#[deprecated(since = "0.11.0", note = "Use `register_module` instead")]
554-
#[cfg(not(feature = "luau"))]
555-
#[cfg(not(tarpaulin_include))]
556-
pub fn load_from_function<T: FromLua>(&self, modname: &str, func: Function) -> Result<T> {
557-
let loaded = unsafe {
558-
self.exec_raw::<Table>((), |state| {
559-
ffi::luaL_getsubtable(state, ffi::LUA_REGISTRYINDEX, ffi::LUA_LOADED_TABLE);
560-
})?
561-
};
562-
563-
let value = match loaded.raw_get(modname)? {
564-
Value::Nil => {
565-
let result = match func.call(modname)? {
566-
Value::Nil => Value::Boolean(true),
567-
res => res,
568-
};
569-
loaded.raw_set(modname, &result)?;
570-
result
571-
}
572-
res => res,
573-
};
574-
T::from_lua(value, self)
575-
}
576-
577552
/// Unloads module `modname`.
578553
///
579554
/// This method does not support unloading binary Lua modules since they are internally cached

0 commit comments

Comments
 (0)