From 89cf5bf362c105d98f499cf9d39b82dfe32ec213 Mon Sep 17 00:00:00 2001 From: Alex Orlenko Date: Sun, 20 Aug 2023 12:15:25 +0100 Subject: [PATCH] impl Default for Lua --- src/lua.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lua.rs b/src/lua.rs index ee6c6ab7..57fb3049 100644 --- a/src/lua.rs +++ b/src/lua.rs @@ -282,6 +282,13 @@ impl Deref for Lua { } } +impl Default for Lua { + #[inline] + fn default() -> Self { + Lua::new() + } +} + impl Lua { /// Creates a new Lua state and loads the **safe** subset of the standard libraries. /// @@ -292,7 +299,6 @@ impl Lua { /// See [`StdLib`] documentation for a list of unsafe modules that cannot be loaded. /// /// [`StdLib`]: crate::StdLib - #[allow(clippy::new_without_default)] pub fn new() -> Lua { mlua_expect!( Self::new_with(StdLib::ALL_SAFE, LuaOptions::default()),