mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-04 17:22:19 +00:00
cleanup legacy_numeric_constants
Removes an unnecessary use of `span_lint_hir_and_then()` where `span_lint_and_then()` would do.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use clippy_config::Conf;
|
||||
use clippy_utils::diagnostics::{span_lint_and_then, span_lint_hir_and_then};
|
||||
use clippy_utils::diagnostics::span_lint_and_then;
|
||||
use clippy_utils::msrvs::{self, Msrv};
|
||||
use clippy_utils::{get_parent_expr, is_from_proc_macro};
|
||||
use hir::def_id::DefId;
|
||||
@@ -143,7 +143,7 @@ impl<'tcx> LateLintPass<'tcx> for LegacyNumericConstants {
|
||||
&& self.msrv.meets(cx, msrvs::NUMERIC_ASSOCIATED_CONSTANTS)
|
||||
&& !is_from_proc_macro(cx, expr)
|
||||
{
|
||||
span_lint_hir_and_then(cx, LEGACY_NUMERIC_CONSTANTS, expr.hir_id, span, msg, |diag| {
|
||||
span_lint_and_then(cx, LEGACY_NUMERIC_CONSTANTS, span, msg, |diag| {
|
||||
diag.span_suggestion_verbose(
|
||||
span,
|
||||
"use the associated constant instead",
|
||||
|
||||
Reference in New Issue
Block a user