Skip to content

Commit 35bfe1e

Browse files
committed
Requested changes
1 parent 802a6d3 commit 35bfe1e

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

clippy_lints/src/misc_early.rs

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::utils::{constants, snippet, snippet_opt, span_help_and_lint, span_lint, span_lint_and_then};
1+
use crate::utils::{constants, snippet, snippet_opt, span_help_and_lint, span_lint, span_lint_and_then, span_lint_and_sugg};
22
use if_chain::if_chain;
33
use rustc::lint::{in_external_macro, EarlyContext, EarlyLintPass, LintArray, LintContext, LintPass};
44
use rustc::{declare_lint_pass, declare_tool_lint};
@@ -399,19 +399,14 @@ impl MiscEarlyLints {
399399
for (idx, ch) in src.chars().enumerate() {
400400
if ch == 'i' || ch == 'u' {
401401
if prev != '_' {
402-
span_lint_and_then(
402+
span_lint_and_sugg(
403403
cx,
404404
UNSEPARATED_LITERAL_SUFFIX,
405405
lit.span,
406406
"integer type suffix should be separated by an underscore",
407-
|db| {
408-
db.span_suggestion(
409-
lit.span,
410-
"add an underscore",
411-
format!("{}_{}", &src[0..idx], &src[idx..]),
412-
Applicability::MachineApplicable,
413-
);
414-
},
407+
"add an underscore",
408+
format!("{}_{}", &src[0..idx], &src[idx..]),
409+
Applicability::MachineApplicable,
415410
);
416411
}
417412
break;
@@ -466,19 +461,14 @@ impl MiscEarlyLints {
466461
for (idx, ch) in src.chars().enumerate() {
467462
if ch == 'f' {
468463
if prev != '_' {
469-
span_lint_and_then(
464+
span_lint_and_sugg(
470465
cx,
471466
UNSEPARATED_LITERAL_SUFFIX,
472467
lit.span,
473468
"float type suffix should be separated by an underscore",
474-
|db| {
475-
db.span_suggestion(
476-
lit.span,
477-
"add an underscore",
478-
format!("{}_{}", &src[0..idx], &src[idx..]),
479-
Applicability::MachineApplicable,
480-
);
481-
},
469+
"add an underscore",
470+
format!("{}_{}", &src[0..idx], &src[idx..]),
471+
Applicability::MachineApplicable,
482472
);
483473
}
484474
break;

0 commit comments

Comments
 (0)