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

View File

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

View File

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

View File

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