Remove unnecessary .to_string()/.as_str()s
This commit is contained in:
@@ -3288,7 +3288,7 @@ impl<'a> Parser<'a> {
|
||||
} else {
|
||||
Applicability::MaybeIncorrect
|
||||
};
|
||||
err.span_suggestion_verbose(sugg_sp, msg, "=> ".to_string(), applicability);
|
||||
err.span_suggestion_verbose(sugg_sp, msg, "=> ", applicability);
|
||||
}
|
||||
}
|
||||
err
|
||||
|
||||
@@ -148,7 +148,7 @@ impl<'a> Parser<'a> {
|
||||
.with_span_suggestion_verbose(
|
||||
mistyped_const_ident.span,
|
||||
"use the `const` keyword",
|
||||
kw::Const.as_str(),
|
||||
kw::Const,
|
||||
Applicability::MachineApplicable,
|
||||
)
|
||||
.emit();
|
||||
|
||||
@@ -1453,7 +1453,7 @@ impl<'a> Parser<'a> {
|
||||
err.span_suggestion_verbose(
|
||||
prev_span,
|
||||
"perhaps you meant to use `struct` here",
|
||||
"struct".to_string(),
|
||||
"struct",
|
||||
Applicability::MaybeIncorrect,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user