File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 33
33
where we have unique behavior intended for a particular expression.
34
34
35
35
If needing to specialize logic within the macro based on a particular
36
- expression's value, it may be better to not use a declarative macro.
36
+ expression's value, it is better to not use a declarative macro.
37
37
38
38
.. non_compliant_example ::
39
39
:id: non_compl_ex_5vK0CCmePkef
@@ -43,6 +43,11 @@ Macros
43
43
matching is done sequentially through the matchers and stops at the first
44
44
match, the specialized case for EmergencyValve is unreachable.
45
45
46
+ The example would also be non-compliant if the ordering of the matchers
47
+ were reversed as this introduces the possibility of future human-error
48
+ when refactoring the macro to place the specialized matcher after the
49
+ generic matcher.
50
+
46
51
.. code-block :: rust
47
52
48
53
#[derive(Debug)]
You can’t perform that action at this time.
0 commit comments