diff --git a/Cargo.lock b/Cargo.lock index 92ceea2..071f4c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -109,7 +109,7 @@ dependencies = [ [[package]] name = "gmod" -version = "16.0.0" +version = "16.0.1" dependencies = [ "cfg_table", "cstr", diff --git a/gmod/Cargo.toml b/gmod/Cargo.toml index cb237a4..51bb8cc 100644 --- a/gmod/Cargo.toml +++ b/gmod/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gmod" -version = "16.0.0" +version = "16.0.1" authors = ["William Venner "] edition = "2021" license = "MIT" diff --git a/gmod/src/lua/returns.rs b/gmod/src/lua/returns.rs index d17f1e2..9728d68 100644 --- a/gmod/src/lua/returns.rs +++ b/gmod/src/lua/returns.rs @@ -61,4 +61,13 @@ impl From> for ValuesReturned { Err(err) => unsafe { super::state().error(err.display_lua_error().as_ref()) } } } +} +impl From> for ValuesReturned { + #[inline(always)] + fn from(res: Result<(), E>) -> ValuesReturned { + match res { + Ok(_) => ValuesReturned(0), + Err(err) => unsafe { super::state().error(err.display_lua_error().as_ref()) } + } + } } \ No newline at end of file