Skip to content

Commit 5cf3893

Browse files
committed
PR review comments <3
1 parent 85b3084 commit 5cf3893

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

clippy_lints/src/float_literal.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,15 @@ impl<'tcx> LateLintPass<'tcx> for FloatLiteral {
106106
if is_whole && !sym_str.contains(['e', 'E']) {
107107
// Normalize the literal by stripping the fractional portion
108108
if sym_str.split('.').next().unwrap() != float_str {
109-
// If the type suffix is missing the suggestion would be
110-
// incorrectly interpreted as an integer so adding a `.0`
111-
// suffix to prevent that.
112-
113109
span_lint_and_then(
114110
cx,
115111
LOSSY_FLOAT_LITERAL,
116112
expr.span,
117113
"literal cannot be represented as the underlying type without loss of precision",
118114
|diag| {
115+
// If the type suffix is missing the suggestion would be
116+
// incorrectly interpreted as an integer so adding a `.0`
117+
// suffix to prevent that.
119118
if type_suffix.is_none() {
120119
float_str.push_str(".0");
121120
}

clippy_lints/src/methods/map_err_ignore.rs

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ pub(super) fn check(cx: &LateContext<'_>, e: &Expr<'_>, arg: &Expr<'_>) {
3030
"`map_err(|_|...` wildcard pattern discards the original error",
3131
|diag| {
3232
diag.help(
33-
3433
"consider storing the original error as a source in the new error, or silence this warning using an ignored identifier (`.map_err(|_foo| ...`)",
3534
);
3635
},

0 commit comments

Comments
 (0)