aboutsummaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-10-25 22:49:24 +0200
committerHampusM <hampus@hampusmat.com>2022-10-25 22:49:24 +0200
commitda94fd3b7dd2265f10957d0f5276881beb057d82 (patch)
tree75dada11e95be52cb24ac345480bf350220a8c78 /macros
parentdba27b4402648b6a9272cda681ab8caaeb5d279d (diff)
refactor: improve injectable macro error messages
Diffstat (limited to 'macros')
-rw-r--r--macros/src/lib.rs7
1 files changed, 6 insertions, 1 deletions
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<Dependency> = parse(impl_stream).unwrap();
+ let injectable_impl: InjectableImpl<Dependency> = 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);