rustc_lint: remove unused to_string
In this instance, we can just pass a &str slice and save an allocation.
This commit is contained in:
parent
4d247ad7d3
commit
c647735f40
1 changed files with 3 additions and 3 deletions
|
@ -145,9 +145,9 @@ fn lint_overflowing_range_endpoint<'tcx>(
|
||||||
// We need to preserve the literal's suffix,
|
// We need to preserve the literal's suffix,
|
||||||
// as it may determine typing information.
|
// as it may determine typing information.
|
||||||
let suffix = match lit.node {
|
let suffix = match lit.node {
|
||||||
LitKind::Int(_, LitIntType::Signed(s)) => s.name_str().to_string(),
|
LitKind::Int(_, LitIntType::Signed(s)) => s.name_str(),
|
||||||
LitKind::Int(_, LitIntType::Unsigned(s)) => s.name_str().to_string(),
|
LitKind::Int(_, LitIntType::Unsigned(s)) => s.name_str(),
|
||||||
LitKind::Int(_, LitIntType::Unsuffixed) => "".to_string(),
|
LitKind::Int(_, LitIntType::Unsuffixed) => "",
|
||||||
_ => bug!(),
|
_ => bug!(),
|
||||||
};
|
};
|
||||||
let suggestion = format!("{}..={}{}", start, lit_val - 1, suffix);
|
let suggestion = format!("{}..={}{}", start, lit_val - 1, suffix);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue