742: Only 1 argument in embassy::main when there is no HAL r=Dirbaio a=jbeaurivage

There is a slight mistake in an error message from `[embassy::main]` macro. When there is no HAL specified, `main` should take only one argument.

Co-authored-by: Justin Beaurivage <justin@wearableavionics.com>
This commit is contained in:
bors[bot] 2022-04-29 14:29:26 +00:00 committed by GitHub
commit 2f43969dd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,7 +42,7 @@ pub fn run(args: syn::AttributeArgs, f: syn::ItemFn) -> Result<TokenStream, Toke
ctxt.error_spanned_by(&f.sig, "main function must have 2 arguments"); ctxt.error_spanned_by(&f.sig, "main function must have 2 arguments");
} }
if HAL.is_none() && fargs.len() != 1 { if HAL.is_none() && fargs.len() != 1 {
ctxt.error_spanned_by(&f.sig, "main function must have 2 arguments"); ctxt.error_spanned_by(&f.sig, "main function must have 1 argument");
} }
ctxt.check()?; ctxt.check()?;