From da94fd3b7dd2265f10957d0f5276881beb057d82 Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 25 Oct 2022 22:49:24 +0200 Subject: refactor: improve injectable macro error messages --- macros/src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'macros') diff --git a/macros/src/lib.rs b/macros/src/lib.rs index c3bc86b..54c7951 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -132,7 +132,12 @@ pub fn injectable(args_stream: TokenStream, impl_stream: TokenStream) -> TokenSt .find(|flag| flag.flag.to_string().as_str() == "async") .map_or(false, |flag| flag.is_on.value); - let injectable_impl: InjectableImpl = parse(impl_stream).unwrap(); + let injectable_impl: InjectableImpl = match parse(impl_stream) { + Ok(injectable_impl) => injectable_impl, + Err(err) => { + panic!("{err}"); + } + }; let expanded_injectable_impl = injectable_impl.expand(no_doc_hidden, is_async); -- cgit v1.2.3-18-g5258