From 2ee7db0b3b6df787c7e62d3614f97a0e45d12a12 Mon Sep 17 00:00:00 2001 From: Akshay Date: Wed, 15 Sep 2021 16:19:43 +0530 Subject: implement lint_map --- lib/src/lints/bool_comparison.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/src/lints') 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 @@ -use crate::{Diagnostic, Lint, Metadata, Rule}; +use crate::{Lint, Metadata, Report, Rule}; use if_chain::if_chain; use macros::lint; @@ -10,12 +10,12 @@ use rnix::{ #[lint( name = "bool_comparison", note = "Unnecessary comparison with boolean", - match_with = "SyntaxKind::NODE_BIN_OP" + match_with = SyntaxKind::NODE_BIN_OP )] struct BoolComparison; impl Rule for BoolComparison { - fn validate(&self, node: &SyntaxElement) -> Option { + fn validate(&self, node: &SyntaxElement) -> Option { if_chain! { if let NodeOrToken::Node(bin_op_node) = node; if let Some(bin_expr) = BinOp::cast(bin_op_node.clone()); @@ -37,7 +37,7 @@ impl Rule for BoolComparison { non_bool_side, bool_side ); - dbg!(Some(Diagnostic::new(at, message))) + Some(Report::new().diagnostic(at, message)) } else { None } -- cgit v1.2.3