diff options
author | Akshay <[email protected]> | 2021-10-31 09:05:58 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2021-10-31 09:05:58 +0000 |
commit | 1748d5f1546d2160ec8f949a56081403a3f9df62 (patch) | |
tree | 52bfa4cbe92a3d7cbf2e54e4dfadaa0f469d95ad /lib/src/lints/collapsible_let_in.rs | |
parent | d085cad4370ab9759e616a7a4513f78cfe0b21be (diff) |
begin writing explainations
Diffstat (limited to 'lib/src/lints/collapsible_let_in.rs')
-rw-r--r-- | lib/src/lints/collapsible_let_in.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/src/lints/collapsible_let_in.rs b/lib/src/lints/collapsible_let_in.rs index 878d218..cb76c37 100644 --- a/lib/src/lints/collapsible_let_in.rs +++ b/lib/src/lints/collapsible_let_in.rs | |||
@@ -1,12 +1,12 @@ | |||
1 | use crate::{make, Lint, Metadata, Report, Rule, Suggestion}; | 1 | use crate::{make, Metadata, Report, Rule, Suggestion}; |
2 | 2 | ||
3 | use if_chain::if_chain; | 3 | use if_chain::if_chain; |
4 | use macros::lint; | 4 | use macros::lint; |
5 | use rowan::Direction; | ||
6 | use rnix::{ | 5 | use rnix::{ |
7 | types::{LetIn, TypedNode}, | 6 | types::{LetIn, TypedNode}, |
8 | NodeOrToken, SyntaxElement, SyntaxKind, TextRange | 7 | NodeOrToken, SyntaxElement, SyntaxKind, TextRange, |
9 | }; | 8 | }; |
9 | use rowan::Direction; | ||
10 | 10 | ||
11 | #[lint( | 11 | #[lint( |
12 | name = "collapsible let in", | 12 | name = "collapsible let in", |
@@ -47,7 +47,7 @@ impl Rule for CollapsibleLetIn { | |||
47 | let replacement = make::empty().node().clone(); | 47 | let replacement = make::empty().node().clone(); |
48 | 48 | ||
49 | Some( | 49 | Some( |
50 | Self::report() | 50 | self.report() |
51 | .diagnostic(first_annotation, first_message) | 51 | .diagnostic(first_annotation, first_message) |
52 | .suggest(second_annotation, second_message, Suggestion::new(replacement_at, replacement)) | 52 | .suggest(second_annotation, second_message, Suggestion::new(replacement_at, replacement)) |
53 | ) | 53 | ) |
@@ -57,4 +57,3 @@ impl Rule for CollapsibleLetIn { | |||
57 | } | 57 | } |
58 | } | 58 | } |
59 | } | 59 | } |
60 | |||