Skip to content

Commit ba8ed6c

Browse files
authored
test-macros: Fix default return type (#9469)
This commit fixes the handling of default return types in `wasmtime-test-macros`. Prior to this commit, functions returning `()` inserted a `()` after the return output, which resulted in a syntax error. This commit fixes this issue by quoting empty tokens when the return type is the default one.
1 parent 877e8f4 commit ba8ed6c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/test-macros/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ fn expand(test_config: &TestConfig, func: Fn) -> Result<TokenStream> {
218218
};
219219
let func_name = &func.sig.ident;
220220
let ret = match &func.sig.output {
221-
ReturnType::Default => quote! { () },
221+
ReturnType::Default => quote! {},
222222
ReturnType::Type(_, ty) => quote! { -> #ty },
223223
};
224224
let test_name = Ident::new(

0 commit comments

Comments
 (0)