remove unnecessary to_string and String::new for tool_only_span_suggestion
This commit is contained in:
@@ -271,7 +271,7 @@ impl<'a> Resolver<'a> {
|
||||
err.tool_only_span_suggestion(
|
||||
import.use_span_with_attributes,
|
||||
"remove unnecessary import",
|
||||
String::new(),
|
||||
"",
|
||||
Applicability::MaybeIncorrect,
|
||||
);
|
||||
}
|
||||
@@ -396,12 +396,7 @@ impl<'a> Resolver<'a> {
|
||||
// previous imports.
|
||||
if found_closing_brace {
|
||||
if let Some(span) = extend_span_to_previous_binding(self.session, span) {
|
||||
err.tool_only_span_suggestion(
|
||||
span,
|
||||
message,
|
||||
String::new(),
|
||||
Applicability::MaybeIncorrect,
|
||||
);
|
||||
err.tool_only_span_suggestion(span, message, "", Applicability::MaybeIncorrect);
|
||||
} else {
|
||||
// Remove the entire line if we cannot extend the span back, this indicates an
|
||||
// `issue_52891::{self}` case.
|
||||
|
||||
Reference in New Issue
Block a user