Fix `return` in `gmod13_close`

This commit is contained in:
William Venner 2022-01-04 21:56:01 +00:00
parent 81369ac975
commit 3ae39ac3b3
4 changed files with 7 additions and 7 deletions

6
Cargo.lock generated
View File

@ -135,7 +135,7 @@ dependencies = [
[[package]]
name = "gmod"
version = "11.0.1"
version = "11.0.2"
dependencies = [
"cfg_table 1.0.0",
"cstr",
@ -144,7 +144,7 @@ dependencies = [
"fn_abi",
"fn_has_this",
"fn_type_alias",
"gmod-macros 1.0.3",
"gmod-macros 1.0.4",
"gmserverplugin",
"lazy_static",
"libloading",
@ -165,7 +165,7 @@ dependencies = [
[[package]]
name = "gmod-macros"
version = "1.0.3"
version = "1.0.4"
dependencies = [
"proc-macro2",
"quote",

View File

@ -1,6 +1,6 @@
[package]
name = "gmod-macros"
version = "1.0.3"
version = "1.0.4"
authors = ["William Venner <william@venner.io>"]
edition = "2018"
license = "MIT"

View File

@ -44,7 +44,7 @@ pub fn gmod13_close(_attr: TokenStream, tokens: TokenStream) -> TokenStream {
#[cfg(feature = "gmcl")] {
let stmts = std::mem::take(&mut input.block.stmts);
input.block.stmts = vec![syn::parse2(quote!({
let ret = {#(#stmts);*};
let ret = (|| {#(#stmts);*})();
::gmod::gmcl::restore_stdout();
ret
})).unwrap()];

View File

@ -1,6 +1,6 @@
[package]
name = "gmod"
version = "11.0.1"
version = "11.0.2"
authors = ["William Venner <william@venner.io>"]
edition = "2018"
license = "MIT"
@ -16,7 +16,7 @@ server-plugin = ["gmserverplugin"]
gmcl = ["gmod-macros/gmcl"]
[dependencies]
gmod-macros = { version = "1.0.3", path = "../gmod-macros" }
gmod-macros = { version = "1.0.4", path = "../gmod-macros" }
gmserverplugin = { version = "1", optional = true }
libloading = "0"