From 15693956c381849dee6c83023bbfd267bf698743 Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Wed, 5 Feb 2025 07:41:57 -0500 Subject: [PATCH 1/2] fix various typos in the codebase --- src/state/util.rs | 2 +- tests/function.rs | 2 +- tests/scope.rs | 2 +- tests/tests.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/state/util.rs b/src/state/util.rs index ec701eaf..9dbf3e85 100644 --- a/src/state/util.rs +++ b/src/state/util.rs @@ -23,7 +23,7 @@ impl Drop for StateGuard<'_> { } // An optimized version of `callback_error` that does not allocate `WrappedFailure` userdata -// and instead reuses unsed values from previous calls (or allocates new). +// and instead reuses unused values from previous calls (or allocates new). pub(super) unsafe fn callback_error_ext( state: *mut ffi::lua_State, mut extra: *mut ExtraData, diff --git a/tests/function.rs b/tests/function.rs index b8c10703..683eca9c 100644 --- a/tests/function.rs +++ b/tests/function.rs @@ -214,7 +214,7 @@ fn test_function_dump() -> Result<()> { #[cfg(feature = "luau")] #[test] -fn test_finction_coverage() -> Result<()> { +fn test_function_coverage() -> Result<()> { let lua = Lua::new(); lua.set_compiler(mlua::Compiler::default().set_coverage_level(1)); diff --git a/tests/scope.rs b/tests/scope.rs index 4113f385..696b65f4 100644 --- a/tests/scope.rs +++ b/tests/scope.rs @@ -318,7 +318,7 @@ fn test_scope_userdata_drop() -> Result<()> { let ud = lua.globals().get::("ud")?; match ud.borrow_scoped::(|_| Ok::<_, Error>(())) { - Ok(_) => panic!("succesfull borrow for destructed userdata"), + Ok(_) => panic!("successful borrow for destructed userdata"), Err(Error::UserDataDestructed) => {} Err(err) => panic!("improper borrow error for destructed userdata: {err:?}"), } diff --git a/tests/tests.rs b/tests/tests.rs index 89bece8a..ae413117 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -322,7 +322,7 @@ fn test_error() -> Result<()> { let return_string_error = globals.get::("return_string_error")?; assert!(return_string_error.call::(()).is_ok()); - match lua.load("if youre happy and you know it syntax error").exec() { + match lua.load("if you're happy and you know it syntax error").exec() { Err(Error::SyntaxError { incomplete_input: false, .. From 25501b9a0610eb296787f48a9346870718a177ee Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Wed, 5 Feb 2025 07:42:26 -0500 Subject: [PATCH 2/2] fix typos in CHANGELOG.md --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbfa550a..df129889 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -467,7 +467,7 @@ Breaking changes: - [**Breaking**] Removed `AnyUserData::has_metamethod()` - Added `Thread::reset()` for luajit/lua54 to recycle threads. It's possible to attach a new function to a thread (coroutine). -- Added `chunk!` macro support to load chunks of Lua code using the Rust tokenizer and optinally capturing Rust variables. +- Added `chunk!` macro support to load chunks of Lua code using the Rust tokenizer and optionally capturing Rust variables. - Improved error reporting (`Error`'s `__tostring` method formats full stacktraces). This is useful in the module mode. ## v0.6.0-beta.1 @@ -523,7 +523,7 @@ Breaking changes: - Lua 5.4 support with `MetaMethod::Close`. - `lua53` feature is disabled by default. Now preferred Lua version have to be chosen explicitly. -- Provide safety guaraness for Lua state, which means that potenially unsafe operations, like loading C modules (using `require` or `package.loadlib`) are disabled. Equalient for the previous `Lua::new()` function is `Lua::unsafe_new()`. +- Provide safety guarantees for Lua state, which means that potentially unsafe operations, like loading C modules (using `require` or `package.loadlib`) are disabled. Equivalent to the previous `Lua::new()` function is `Lua::unsafe_new()`. - New `send` feature to require `Send`. - New `module` feature, that disables linking to Lua Core Libraries. Required for modules. - Don't allow `'callback` outlive `'lua` in `Lua::create_function()` to fix [the unsoundness](tests/compile/static_callback_args.rs).