From 6400a3b818eac49b35cd6e73a7c4df6540285bf6 Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 1 Aug 2023 17:27:50 +0200 Subject: test: clean up InjectableMacroArgs unit tests --- macros/src/injectable/macro_args.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'macros') diff --git a/macros/src/injectable/macro_args.rs b/macros/src/injectable/macro_args.rs index 6582cc6..6964352 100644 --- a/macros/src/injectable/macro_args.rs +++ b/macros/src/injectable/macro_args.rs @@ -146,8 +146,7 @@ mod tests let injectable_macro_args = parse2::(input_args)?; - assert!(matches!(injectable_macro_args.interface, None)); - + assert!(injectable_macro_args.interface.is_none()); assert!(injectable_macro_args.flags.is_empty()); Ok(()) @@ -173,7 +172,7 @@ mod tests assert_eq!( injectable_macro_args.flags, - Punctuated::from_iter(vec![ + Punctuated::from_iter([ MacroFlag { flag: format_ident!("no_doc_hidden"), is_on: LitBool::new(true, Span::call_site()) @@ -197,11 +196,11 @@ mod tests let injectable_macro_args = parse2::(input_args)?; - assert!(matches!(injectable_macro_args.interface, None)); + assert!(injectable_macro_args.interface.is_none()); assert_eq!( injectable_macro_args.flags, - Punctuated::from_iter(vec![ + Punctuated::from_iter([ MacroFlag { flag: format_ident!("async"), is_on: LitBool::new(false, Span::call_site()) @@ -217,15 +216,13 @@ mod tests } #[test] - fn can_parse_with_unknown_flag() -> Result<(), Box> + fn can_parse_with_unknown_flag() { let input_args = quote! { IFoo, haha = true, async = false }; assert!(parse2::(input_args).is_ok()); - - Ok(()) } #[test] -- cgit v1.2.3-18-g5258