File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,8 @@ and resolved paths.
54
54
[ ` T-AST ` ] issues will generally need you to match against a predefined syntax structure.
55
55
To figure out how this syntax structure is encoded in the AST, it is recommended to run
56
56
` rustc -Z ast-json ` on an example of the structure and compare with the [ nodes in the AST docs] .
57
- Usually the lint will end up to be a nested series of matches and ifs, [ like so] .
57
+ Usually the lint will end up to be a nested series of matches and ifs, [ like so] [ deep-nesting ] .
58
+ But we can make it nest-less by using [ if_chain] macro, [ like this] [ nest-less ] .
58
59
59
60
[ ` E-medium ` ] issues are generally pretty easy too, though it's recommended you work on an E-easy issue first.
60
61
They are mostly classified as [ ` E-medium ` ] , since they might be somewhat involved code wise,
@@ -71,7 +72,9 @@ an AST expression). `match_def_path()` in Clippy's `utils` module can also be us
71
72
[ `E-medium` ] : https://github.com/rust-lang/rust-clippy/labels/E-medium
72
73
[ `ty` ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty
73
74
[ nodes in the AST docs ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/ast/
74
- [ like so ] : https://github.com/rust-lang/rust-clippy/blob/de5ccdfab68a5e37689f3c950ed1532ba9d652a0/src/misc.rs#L34
75
+ [ deep-nesting ] : https://github.com/rust-lang/rust-clippy/blob/557f6848bd5b7183f55c1e1522a326e9e1df6030/clippy_lints/src/mem_forget.rs#L29-L43
76
+ [ if_chain ] : https://docs.rs/if_chain/*/if_chain
77
+ [ nest-less ] : https://github.com/rust-lang/rust-clippy/blob/557f6848bd5b7183f55c1e1522a326e9e1df6030/clippy_lints/src/bit_mask.rs#L124-L150
75
78
76
79
## Writing code
77
80
You can’t perform that action at this time.
0 commit comments