diff options
Diffstat (limited to 'lib/src/lints/bool_comparison.rs')
-rw-r--r-- | lib/src/lints/bool_comparison.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/src/lints/bool_comparison.rs b/lib/src/lints/bool_comparison.rs index 4476b31..918126f 100644 --- a/lib/src/lints/bool_comparison.rs +++ b/lib/src/lints/bool_comparison.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use crate::{Diagnostic, Lint, Metadata, Rule}; | 1 | use crate::{Lint, Metadata, Report, Rule}; |
2 | 2 | ||
3 | use if_chain::if_chain; | 3 | use if_chain::if_chain; |
4 | use macros::lint; | 4 | use macros::lint; |
@@ -10,12 +10,12 @@ use rnix::{ | |||
10 | #[lint( | 10 | #[lint( |
11 | name = "bool_comparison", | 11 | name = "bool_comparison", |
12 | note = "Unnecessary comparison with boolean", | 12 | note = "Unnecessary comparison with boolean", |
13 | match_with = "SyntaxKind::NODE_BIN_OP" | 13 | match_with = SyntaxKind::NODE_BIN_OP |
14 | )] | 14 | )] |
15 | struct BoolComparison; | 15 | struct BoolComparison; |
16 | 16 | ||
17 | impl Rule for BoolComparison { | 17 | impl Rule for BoolComparison { |
18 | fn validate(&self, node: &SyntaxElement) -> Option<Diagnostic> { | 18 | fn validate(&self, node: &SyntaxElement) -> Option<Report> { |
19 | if_chain! { | 19 | if_chain! { |
20 | if let NodeOrToken::Node(bin_op_node) = node; | 20 | if let NodeOrToken::Node(bin_op_node) = node; |
21 | if let Some(bin_expr) = BinOp::cast(bin_op_node.clone()); | 21 | if let Some(bin_expr) = BinOp::cast(bin_op_node.clone()); |
@@ -37,7 +37,7 @@ impl Rule for BoolComparison { | |||
37 | non_bool_side, | 37 | non_bool_side, |
38 | bool_side | 38 | bool_side |
39 | ); | 39 | ); |
40 | dbg!(Some(Diagnostic::new(at, message))) | 40 | Some(Report::new().diagnostic(at, message)) |
41 | } else { | 41 | } else { |
42 | None | 42 | None |
43 | } | 43 | } |