File tree Expand file tree Collapse file tree 1 file changed +19
-22
lines changed Expand file tree Collapse file tree 1 file changed +19
-22
lines changed Original file line number Diff line number Diff line change @@ -43,28 +43,25 @@ impl LintPass for Pass {
43
43
impl EarlyLintPass for Pass {
44
44
fn check_mac ( & mut self , cx : & EarlyContext < ' _ > , mac : & ast:: Mac ) {
45
45
if mac. node . path == "dbg" {
46
- match tts_span ( mac. node . tts . clone ( ) ) . and_then ( |span| snippet_opt ( cx, span) ) {
47
- Some ( sugg) => {
48
- span_lint_and_sugg (
49
- cx,
50
- DBG_MACRO ,
51
- mac. span ,
52
- "`dbg!` macro is intended as a debugging tool" ,
53
- "ensure to avoid having uses of it in version control" ,
54
- sugg,
55
- Applicability :: MaybeIncorrect ,
56
- ) ;
57
- }
58
- None => {
59
- span_help_and_lint (
60
- cx,
61
- DBG_MACRO ,
62
- mac. span ,
63
- "`dbg!` macro is intended as a debugging tool" ,
64
- "ensure to avoid having uses of it in version control" ,
65
- ) ;
66
- }
67
- } ;
46
+ if let Some ( sugg) = tts_span ( mac. node . tts . clone ( ) ) . and_then ( |span| snippet_opt ( cx, span) ) {
47
+ span_lint_and_sugg (
48
+ cx,
49
+ DBG_MACRO ,
50
+ mac. span ,
51
+ "`dbg!` macro is intended as a debugging tool" ,
52
+ "ensure to avoid having uses of it in version control" ,
53
+ sugg,
54
+ Applicability :: MaybeIncorrect ,
55
+ ) ;
56
+ } else {
57
+ span_help_and_lint (
58
+ cx,
59
+ DBG_MACRO ,
60
+ mac. span ,
61
+ "`dbg!` macro is intended as a debugging tool" ,
62
+ "ensure to avoid having uses of it in version control" ,
63
+ ) ;
64
+ }
68
65
}
69
66
}
70
67
}
You can’t perform that action at this time.
0 commit comments