Skip to content

Commit

Permalink
fix(macro): wrong check for error attribute (#62)
Browse files Browse the repository at this point in the history
Duplicate-check is used "ty" flag instead of "error"
  • Loading branch information
DDtKey authored Dec 8, 2023
1 parent 458bcf2 commit d888fb5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion proc-macro/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ impl darling::FromMeta for ProtectionArgs {
ty = errors.handle(darling::FromMeta::from_expr(value));
}
} else if path.is_ident("error") {
if ty.is_some() {
if error_fn.is_some() {
errors.push(darling::Error::duplicate_field("error"));
} else {
error_fn = errors.handle(darling::FromMeta::from_expr(value));
Expand Down

0 comments on commit d888fb5

Please sign in to comment.