Skip to content

Commit

Permalink
impl Default for Lua
Browse files Browse the repository at this point in the history
  • Loading branch information
khvzak committed Aug 20, 2023
1 parent bb0a607 commit 89cf5bf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/lua.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand All @@ -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()),
Expand Down

0 comments on commit 89cf5bf

Please sign in to comment.