From 8339621f9c50c361506bff2516d6bf7c9dda0a3e Mon Sep 17 00:00:00 2001 From: Alex Orlenko Date: Fri, 6 Jan 2023 21:35:15 +0000 Subject: Rename `to_lua_err` -> `into_lua_err` --- tests/module/src/lib.rs | 2 +- tests/tests.rs | 4 ++-- tests/userdata.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/module/src/lib.rs b/tests/module/src/lib.rs index 329e15e..3963dbd 100644 --- a/tests/module/src/lib.rs +++ b/tests/module/src/lib.rs @@ -35,5 +35,5 @@ fn rust_module2(lua: &Lua) -> LuaResult { #[mlua::lua_module] fn rust_module_error(_: &Lua) -> LuaResult { - Err("custom module error".to_lua_err()) + Err("custom module error".into_lua_err()) } diff --git a/tests/tests.rs b/tests/tests.rs index e783392..17fae25 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -308,7 +308,7 @@ fn test_error() -> Result<()> { .exec()?; let rust_error_function = - lua.create_function(|_, ()| -> Result<()> { Err(TestError.to_lua_err()) })?; + lua.create_function(|_, ()| -> Result<()> { Err(TestError.into_lua_err()) })?; globals.set("rust_error_function", rust_error_function)?; let no_error = globals.get::<_, Function>("no_error")?; @@ -506,7 +506,7 @@ fn test_result_conversions() -> Result<()> { let err = lua.create_function(|_, ()| { Ok(Err::( - "only through failure can we succeed".to_lua_err(), + "only through failure can we succeed".into_lua_err(), )) })?; let ok = lua.create_function(|_, ()| Ok(Ok::<_, Error>("!".to_owned())))?; diff --git a/tests/userdata.rs b/tests/userdata.rs index f91e840..b37eeeb 100644 --- a/tests/userdata.rs +++ b/tests/userdata.rs @@ -122,7 +122,7 @@ fn test_metamethods() -> Result<()> { if index.to_str()? == "inner" { Ok(data.0) } else { - Err("no such custom index".to_lua_err()) + Err("no such custom index".into_lua_err()) } }); #[cfg(any( -- cgit v1.2.3