removing unsafe from test fn's && renaming shrink to sugg_span

This commit is contained in:
Marek Downar 2022-01-17 12:34:03 +01:00
parent 49502727e7
commit 69d78ceeba
No known key found for this signature in database
GPG key ID: 62D7E3EF71CA85B2
3 changed files with 11 additions and 11 deletions

View file

@ -56,7 +56,7 @@ pub(super) fn check<'tcx>(
then {
let mut applicability = Applicability::MachineApplicable;
let hint = "unwrap_or_default()";
let mut shrink = span;
let mut sugg_span = span;
let mut sugg: String = format!(
"{}.{}",
@ -65,14 +65,14 @@ pub(super) fn check<'tcx>(
);
if sugg.lines().count() > MAX_SUGGESTION_HIGHLIGHT_LINES {
shrink = method_span.with_hi(span.hi());
sugg_span = method_span.with_hi(span.hi());
sugg = hint.to_string();
}
span_lint_and_sugg(
cx,
OR_FUN_CALL,
shrink,
sugg_span,
&format!("use of `{}` followed by a call to `{}`", name, path),
"try this",
sugg,