Skip to content

Commit

Permalink
remove unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
Easyoakland committed Oct 2, 2024
1 parent e4825b2 commit f3cf244
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scroll_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ fn custom_ctx(field: &syn::Field) -> Option<proc_macro2::TokenStream> {
expr = Some(value.parse::<syn::Expr>()?); // parsed #[scroll(ctx = expr)]
return Ok(());
}
Err(meta.error(format!(
"unrecognized attribute: {}",
meta.path.get_ident().unwrap()
)))
Err(meta.error(match meta.path.get_ident() {
Some(ident) => format!("unrecognized attribute: {ident}"),
None => "unrecognized and invalid attribute".to_owned(),
}))
});
match res {
Ok(_) => expr.map(|x| x.into_token_stream()),
Expand Down

0 comments on commit f3cf244

Please sign in to comment.