Allow needless_bool in macro

This commit is contained in:
Cameron Steffen 2021-06-09 14:44:42 -05:00
parent 94d6be4c0a
commit 3fc8dae46c

View File

@ -71,6 +71,9 @@
impl<'tcx> LateLintPass<'tcx> for NeedlessBool {
fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) {
use self::Expression::{Bool, RetBool};
if e.span.from_expansion() {
return;
}
if let ExprKind::If(pred, then_block, Some(else_expr)) = e.kind {
let reduce = |ret, not| {
let mut applicability = Applicability::MachineApplicable;