Compute fix kind from metatadata #2799
Labels
good first issue
Good for newcomers
S-Help-wanted
Status: you're familiar with the code base and want to help the project
The
RuleAction
now accepts anapplicability
field, determining whether the action is safe/unsafe.However, we also provide the same information to our
RuleMeta
, which isfix_kind
.Once #2798 is completed, we can retrieve the
fix_kind
usingctx.metadata().fix_kind
.The idea is to create a method inside
FixKind
calledinto_applicability
that returnsApplicability
. This method should panic (use .expect()
) if the fix kind isn't provided via macro.The field
applicability
should become private (removepub
), however do that at the end. I suggest to create a new method callednew
insideRuleAction
, and then progressively phase out the manual construction of the structAs a rule, we should have:
The text was updated successfully, but these errors were encountered: