diff --git a/crates/ruff_linter/src/rules/eradicate/rules/commented_out_code.rs b/crates/ruff_linter/src/rules/eradicate/rules/commented_out_code.rs index 5810ef58c6..2c9d3b2848 100644 --- a/crates/ruff_linter/src/rules/eradicate/rules/commented_out_code.rs +++ b/crates/ruff_linter/src/rules/eradicate/rules/commented_out_code.rs @@ -41,7 +41,7 @@ impl Violation for CommentedOutCode { } fn fix_title(&self) -> Option { - Some(format!("Remove commented-out code")) + Some("Remove commented-out code".to_string()) } } diff --git a/crates/ruff_linter/src/rules/flake8_annotations/rules/definition.rs b/crates/ruff_linter/src/rules/flake8_annotations/rules/definition.rs index b1e5cbbf98..6f8590b957 100644 --- a/crates/ruff_linter/src/rules/flake8_annotations/rules/definition.rs +++ b/crates/ruff_linter/src/rules/flake8_annotations/rules/definition.rs @@ -229,12 +229,11 @@ impl Violation for MissingReturnTypeUndocumentedPublicFunction { } fn fix_title(&self) -> Option { - let Self { annotation, .. } = self; - if let Some(annotation) = annotation { - Some(format!("Add return type annotation: `{annotation}`")) - } else { - Some(format!("Add return type annotation")) - } + let title = match &self.annotation { + Some(annotation) => format!("Add return type annotation: `{annotation}`"), + None => "Add return type annotation".to_string(), + }; + Some(title) } } @@ -273,12 +272,11 @@ impl Violation for MissingReturnTypePrivateFunction { } fn fix_title(&self) -> Option { - let Self { annotation, .. } = self; - if let Some(annotation) = annotation { - Some(format!("Add return type annotation: `{annotation}`")) - } else { - Some(format!("Add return type annotation")) - } + let title = match &self.annotation { + Some(annotation) => format!("Add return type annotation: `{annotation}`"), + None => "Add return type annotation".to_string(), + }; + Some(title) } } @@ -330,12 +328,11 @@ impl Violation for MissingReturnTypeSpecialMethod { } fn fix_title(&self) -> Option { - let Self { annotation, .. } = self; - if let Some(annotation) = annotation { - Some(format!("Add return type annotation: `{annotation}`")) - } else { - Some(format!("Add return type annotation")) - } + let title = match &self.annotation { + Some(annotation) => format!("Add return type annotation: `{annotation}`"), + None => "Add return type annotation".to_string(), + }; + Some(title) } } @@ -378,12 +375,11 @@ impl Violation for MissingReturnTypeStaticMethod { } fn fix_title(&self) -> Option { - let Self { annotation, .. } = self; - if let Some(annotation) = annotation { - Some(format!("Add return type annotation: `{annotation}`")) - } else { - Some(format!("Add return type annotation")) - } + let title = match &self.annotation { + Some(annotation) => format!("Add return type annotation: `{annotation}`"), + None => "Add return type annotation".to_string(), + }; + Some(title) } } @@ -426,12 +422,11 @@ impl Violation for MissingReturnTypeClassMethod { } fn fix_title(&self) -> Option { - let Self { annotation, .. } = self; - if let Some(annotation) = annotation { - Some(format!("Add return type annotation: `{annotation}`")) - } else { - Some(format!("Add return type annotation")) - } + let title = match &self.annotation { + Some(annotation) => format!("Add return type annotation: `{annotation}`"), + None => "Add return type annotation".to_string(), + }; + Some(title) } } diff --git a/crates/ruff_linter/src/rules/flake8_async/rules/sync_call.rs b/crates/ruff_linter/src/rules/flake8_async/rules/sync_call.rs index cccf7fc20b..99a6cf3265 100644 --- a/crates/ruff_linter/src/rules/flake8_async/rules/sync_call.rs +++ b/crates/ruff_linter/src/rules/flake8_async/rules/sync_call.rs @@ -46,7 +46,7 @@ impl Violation for TrioSyncCall { } fn fix_title(&self) -> Option { - Some(format!("Add `await`")) + Some("Add `await`".to_string()) } } diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/rules/duplicate_value.rs b/crates/ruff_linter/src/rules/flake8_bugbear/rules/duplicate_value.rs index 56797bfeea..0ef4427306 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/rules/duplicate_value.rs +++ b/crates/ruff_linter/src/rules/flake8_bugbear/rules/duplicate_value.rs @@ -50,7 +50,7 @@ impl Violation for DuplicateValue { } fn fix_title(&self) -> Option { - Some(format!("Remove duplicate item")) + Some("Remove duplicate item".to_string()) } } diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/rules/mutable_argument_default.rs b/crates/ruff_linter/src/rules/flake8_bugbear/rules/mutable_argument_default.rs index 3c79942030..79ceee5060 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/rules/mutable_argument_default.rs +++ b/crates/ruff_linter/src/rules/flake8_bugbear/rules/mutable_argument_default.rs @@ -80,7 +80,7 @@ impl Violation for MutableArgumentDefault { } fn fix_title(&self) -> Option { - Some(format!("Replace with `None`; initialize within function")) + Some("Replace with `None`; initialize within function".to_string()) } } diff --git a/crates/ruff_linter/src/rules/flake8_bugbear/rules/unreliable_callable_check.rs b/crates/ruff_linter/src/rules/flake8_bugbear/rules/unreliable_callable_check.rs index d076946330..42ef36a5b0 100644 --- a/crates/ruff_linter/src/rules/flake8_bugbear/rules/unreliable_callable_check.rs +++ b/crates/ruff_linter/src/rules/flake8_bugbear/rules/unreliable_callable_check.rs @@ -46,7 +46,7 @@ impl Violation for UnreliableCallableCheck { } fn fix_title(&self) -> Option { - Some(format!("Replace with `callable()`")) + Some("Replace with `callable()`".to_string()) } } diff --git a/crates/ruff_linter/src/rules/flake8_comprehensions/rules/unnecessary_dict_comprehension_for_iterable.rs b/crates/ruff_linter/src/rules/flake8_comprehensions/rules/unnecessary_dict_comprehension_for_iterable.rs index 67cf7e96c7..10ae02d5e6 100644 --- a/crates/ruff_linter/src/rules/flake8_comprehensions/rules/unnecessary_dict_comprehension_for_iterable.rs +++ b/crates/ruff_linter/src/rules/flake8_comprehensions/rules/unnecessary_dict_comprehension_for_iterable.rs @@ -44,11 +44,12 @@ impl Violation for UnnecessaryDictComprehensionForIterable { } fn fix_title(&self) -> Option { - if self.is_value_none_literal { - Some(format!("Replace with `dict.fromkeys(iterable, value)`)")) + let title = if self.is_value_none_literal { + "Replace with `dict.fromkeys(iterable, value)`)" } else { - Some(format!("Replace with `dict.fromkeys(iterable)`)")) - } + "Replace with `dict.fromkeys(iterable)`)" + }; + Some(title.to_string()) } } diff --git a/crates/ruff_linter/src/rules/flake8_executable/rules/shebang_leading_whitespace.rs b/crates/ruff_linter/src/rules/flake8_executable/rules/shebang_leading_whitespace.rs index 9b865f8b5f..0d56b23efc 100644 --- a/crates/ruff_linter/src/rules/flake8_executable/rules/shebang_leading_whitespace.rs +++ b/crates/ruff_linter/src/rules/flake8_executable/rules/shebang_leading_whitespace.rs @@ -39,7 +39,7 @@ impl AlwaysFixableViolation for ShebangLeadingWhitespace { } fn fix_title(&self) -> String { - format!("Remove whitespace before shebang") + "Remove whitespace before shebang".to_string() } } diff --git a/crates/ruff_linter/src/rules/flake8_future_annotations/rules/future_required_type_annotation.rs b/crates/ruff_linter/src/rules/flake8_future_annotations/rules/future_required_type_annotation.rs index ae39f653c8..48f0ab7484 100644 --- a/crates/ruff_linter/src/rules/flake8_future_annotations/rules/future_required_type_annotation.rs +++ b/crates/ruff_linter/src/rules/flake8_future_annotations/rules/future_required_type_annotation.rs @@ -79,7 +79,7 @@ impl AlwaysFixableViolation for FutureRequiredTypeAnnotation { } fn fix_title(&self) -> String { - format!("Add `from __future__ import annotations`") + "Add `from __future__ import annotations`".to_string() } } diff --git a/crates/ruff_linter/src/rules/flake8_logging/rules/direct_logger_instantiation.rs b/crates/ruff_linter/src/rules/flake8_logging/rules/direct_logger_instantiation.rs index ee93f507c4..375c703a80 100644 --- a/crates/ruff_linter/src/rules/flake8_logging/rules/direct_logger_instantiation.rs +++ b/crates/ruff_linter/src/rules/flake8_logging/rules/direct_logger_instantiation.rs @@ -49,7 +49,7 @@ impl Violation for DirectLoggerInstantiation { } fn fix_title(&self) -> Option { - Some(format!("Replace with `logging.getLogger()`")) + Some("Replace with `logging.getLogger()`".to_string()) } } diff --git a/crates/ruff_linter/src/rules/flake8_logging/rules/invalid_get_logger_argument.rs b/crates/ruff_linter/src/rules/flake8_logging/rules/invalid_get_logger_argument.rs index d7c5fa7032..453f665791 100644 --- a/crates/ruff_linter/src/rules/flake8_logging/rules/invalid_get_logger_argument.rs +++ b/crates/ruff_linter/src/rules/flake8_logging/rules/invalid_get_logger_argument.rs @@ -52,7 +52,7 @@ impl Violation for InvalidGetLoggerArgument { } fn fix_title(&self) -> Option { - Some(format!("Replace with `__name__`")) + Some("Replace with `__name__`".to_string()) } } diff --git a/crates/ruff_linter/src/rules/flake8_logging/rules/undocumented_warn.rs b/crates/ruff_linter/src/rules/flake8_logging/rules/undocumented_warn.rs index 8e38ad5e55..af63b6bbdf 100644 --- a/crates/ruff_linter/src/rules/flake8_logging/rules/undocumented_warn.rs +++ b/crates/ruff_linter/src/rules/flake8_logging/rules/undocumented_warn.rs @@ -43,7 +43,7 @@ impl Violation for UndocumentedWarn { } fn fix_title(&self) -> Option { - Some(format!("Replace `logging.WARN` with `logging.WARNING`")) + Some("Replace `logging.WARN` with `logging.WARNING`".to_string()) } } diff --git a/crates/ruff_linter/src/rules/flake8_pie/rules/unnecessary_dict_kwargs.rs b/crates/ruff_linter/src/rules/flake8_pie/rules/unnecessary_dict_kwargs.rs index 4bffddb94a..e41b99c623 100644 --- a/crates/ruff_linter/src/rules/flake8_pie/rules/unnecessary_dict_kwargs.rs +++ b/crates/ruff_linter/src/rules/flake8_pie/rules/unnecessary_dict_kwargs.rs @@ -51,7 +51,7 @@ impl Violation for UnnecessaryDictKwargs { } fn fix_title(&self) -> Option { - Some(format!("Remove unnecessary kwargs")) + Some("Remove unnecessary kwargs".to_string()) } } diff --git a/crates/ruff_linter/src/rules/flake8_pie/rules/unnecessary_placeholder.rs b/crates/ruff_linter/src/rules/flake8_pie/rules/unnecessary_placeholder.rs index 85fafcac08..1a6a7552dc 100644 --- a/crates/ruff_linter/src/rules/flake8_pie/rules/unnecessary_placeholder.rs +++ b/crates/ruff_linter/src/rules/flake8_pie/rules/unnecessary_placeholder.rs @@ -61,19 +61,18 @@ pub struct UnnecessaryPlaceholder { impl AlwaysFixableViolation for UnnecessaryPlaceholder { #[derive_message_formats] fn message(&self) -> String { - let Self { kind } = self; - match kind { + match &self.kind { Placeholder::Pass => format!("Unnecessary `pass` statement"), Placeholder::Ellipsis => format!("Unnecessary `...` literal"), } } fn fix_title(&self) -> String { - let Self { kind } = self; - match kind { - Placeholder::Pass => format!("Remove unnecessary `pass`"), - Placeholder::Ellipsis => format!("Remove unnecessary `...`"), - } + let title = match &self.kind { + Placeholder::Pass => "Remove unnecessary `pass`", + Placeholder::Ellipsis => "Remove unnecessary `...`", + }; + title.to_string() } } diff --git a/crates/ruff_linter/src/rules/flake8_pie/rules/unnecessary_range_start.rs b/crates/ruff_linter/src/rules/flake8_pie/rules/unnecessary_range_start.rs index 86dfaa673d..b12b670f93 100644 --- a/crates/ruff_linter/src/rules/flake8_pie/rules/unnecessary_range_start.rs +++ b/crates/ruff_linter/src/rules/flake8_pie/rules/unnecessary_range_start.rs @@ -37,7 +37,7 @@ impl AlwaysFixableViolation for UnnecessaryRangeStart { } fn fix_title(&self) -> String { - format!("Remove `start` argument") + "Remove `start` argument".to_string() } } diff --git a/crates/ruff_linter/src/rules/flake8_pie/rules/unnecessary_spread.rs b/crates/ruff_linter/src/rules/flake8_pie/rules/unnecessary_spread.rs index 8bff1abe68..9898a3da93 100644 --- a/crates/ruff_linter/src/rules/flake8_pie/rules/unnecessary_spread.rs +++ b/crates/ruff_linter/src/rules/flake8_pie/rules/unnecessary_spread.rs @@ -40,7 +40,7 @@ impl Violation for UnnecessarySpread { } fn fix_title(&self) -> Option { - Some(format!("Remove unnecessary dict")) + Some("Remove unnecessary dict".to_string()) } } diff --git a/crates/ruff_linter/src/rules/flake8_pyi/rules/any_eq_ne_annotation.rs b/crates/ruff_linter/src/rules/flake8_pyi/rules/any_eq_ne_annotation.rs index 01a2d1447e..86a13f41ff 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/rules/any_eq_ne_annotation.rs +++ b/crates/ruff_linter/src/rules/flake8_pyi/rules/any_eq_ne_annotation.rs @@ -54,7 +54,7 @@ impl AlwaysFixableViolation for AnyEqNeAnnotation { } fn fix_title(&self) -> String { - format!("Replace with `object`") + "Replace with `object`".to_string() } } diff --git a/crates/ruff_linter/src/rules/flake8_pyi/rules/collections_named_tuple.rs b/crates/ruff_linter/src/rules/flake8_pyi/rules/collections_named_tuple.rs index 4f63b454d7..2f44371c4c 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/rules/collections_named_tuple.rs +++ b/crates/ruff_linter/src/rules/flake8_pyi/rules/collections_named_tuple.rs @@ -45,7 +45,7 @@ impl Violation for CollectionsNamedTuple { } fn fix_title(&self) -> Option { - Some(format!("Replace with `typing.NamedTuple`")) + Some("Replace with `typing.NamedTuple`".to_string()) } } diff --git a/crates/ruff_linter/src/rules/flake8_pyi/rules/non_empty_stub_body.rs b/crates/ruff_linter/src/rules/flake8_pyi/rules/non_empty_stub_body.rs index 2324a9cb20..ad2f9388f2 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/rules/non_empty_stub_body.rs +++ b/crates/ruff_linter/src/rules/flake8_pyi/rules/non_empty_stub_body.rs @@ -38,7 +38,7 @@ impl AlwaysFixableViolation for NonEmptyStubBody { } fn fix_title(&self) -> String { - format!("Replace function body with `...`") + "Replace function body with `...`".to_string() } } diff --git a/crates/ruff_linter/src/rules/flake8_pyi/rules/pass_in_class_body.rs b/crates/ruff_linter/src/rules/flake8_pyi/rules/pass_in_class_body.rs index 06e13a6090..b81dc3f642 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/rules/pass_in_class_body.rs +++ b/crates/ruff_linter/src/rules/flake8_pyi/rules/pass_in_class_body.rs @@ -36,7 +36,7 @@ impl AlwaysFixableViolation for PassInClassBody { } fn fix_title(&self) -> String { - format!("Remove unnecessary `pass`") + "Remove unnecessary `pass`".to_string() } } diff --git a/crates/ruff_linter/src/rules/flake8_pyi/rules/pass_statement_stub_body.rs b/crates/ruff_linter/src/rules/flake8_pyi/rules/pass_statement_stub_body.rs index ce2dd53b61..0e3e053ff9 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/rules/pass_statement_stub_body.rs +++ b/crates/ruff_linter/src/rules/flake8_pyi/rules/pass_statement_stub_body.rs @@ -35,7 +35,7 @@ impl AlwaysFixableViolation for PassStatementStubBody { } fn fix_title(&self) -> String { - format!("Replace `pass` with `...`") + "Replace `pass` with `...`".to_string() } } diff --git a/crates/ruff_linter/src/rules/flake8_pyi/rules/unaliased_collections_abc_set_import.rs b/crates/ruff_linter/src/rules/flake8_pyi/rules/unaliased_collections_abc_set_import.rs index bb24ed01f0..5cc77163d4 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/rules/unaliased_collections_abc_set_import.rs +++ b/crates/ruff_linter/src/rules/flake8_pyi/rules/unaliased_collections_abc_set_import.rs @@ -54,7 +54,7 @@ impl Violation for UnaliasedCollectionsAbcSetImport { } fn fix_title(&self) -> Option { - Some(format!("Alias `Set` to `AbstractSet`")) + Some("Alias `Set` to `AbstractSet`".to_string()) } } diff --git a/crates/ruff_linter/src/rules/flake8_pyi/rules/unnecessary_type_union.rs b/crates/ruff_linter/src/rules/flake8_pyi/rules/unnecessary_type_union.rs index 1d4128bd56..620fe23afe 100644 --- a/crates/ruff_linter/src/rules/flake8_pyi/rules/unnecessary_type_union.rs +++ b/crates/ruff_linter/src/rules/flake8_pyi/rules/unnecessary_type_union.rs @@ -48,7 +48,7 @@ impl Violation for UnnecessaryTypeUnion { } fn fix_title(&self) -> Option { - Some(format!("Combine multiple `type` members")) + Some("Combine multiple `type` members".to_string()) } } diff --git a/crates/ruff_linter/src/rules/flake8_raise/rules/unnecessary_paren_on_raise_exception.rs b/crates/ruff_linter/src/rules/flake8_raise/rules/unnecessary_paren_on_raise_exception.rs index 0c9e2477fc..30897bf874 100644 --- a/crates/ruff_linter/src/rules/flake8_raise/rules/unnecessary_paren_on_raise_exception.rs +++ b/crates/ruff_linter/src/rules/flake8_raise/rules/unnecessary_paren_on_raise_exception.rs @@ -48,7 +48,7 @@ impl AlwaysFixableViolation for UnnecessaryParenOnRaiseException { } fn fix_title(&self) -> String { - format!("Remove unnecessary parentheses") + "Remove unnecessary parentheses".to_string() } } diff --git a/crates/ruff_linter/src/rules/flake8_simplify/rules/ast_ifexp.rs b/crates/ruff_linter/src/rules/flake8_simplify/rules/ast_ifexp.rs index 2d54023f26..eff935d653 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/rules/ast_ifexp.rs +++ b/crates/ruff_linter/src/rules/flake8_simplify/rules/ast_ifexp.rs @@ -48,12 +48,12 @@ impl Violation for IfExprWithTrueFalse { } fn fix_title(&self) -> Option { - let IfExprWithTrueFalse { is_compare } = self; - if *is_compare { - Some(format!("Remove unnecessary `True if ... else False`")) + let title = if self.is_compare { + "Remove unnecessary `True if ... else False`" } else { - Some(format!("Replace with `bool(...)")) - } + "Replace with `bool(...)" + }; + Some(title.to_string()) } } diff --git a/crates/ruff_linter/src/rules/flake8_simplify/rules/key_in_dict.rs b/crates/ruff_linter/src/rules/flake8_simplify/rules/key_in_dict.rs index 8cc9adff4a..ef4d7c7f59 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/rules/key_in_dict.rs +++ b/crates/ruff_linter/src/rules/flake8_simplify/rules/key_in_dict.rs @@ -50,8 +50,7 @@ impl AlwaysFixableViolation for InDictKeys { } fn fix_title(&self) -> String { - let InDictKeys { operator: _ } = self; - format!("Remove `.keys()`") + "Remove `.keys()`".to_string() } } diff --git a/crates/ruff_linter/src/rules/flake8_simplify/rules/needless_bool.rs b/crates/ruff_linter/src/rules/flake8_simplify/rules/needless_bool.rs index b6dedfd098..c820d68127 100644 --- a/crates/ruff_linter/src/rules/flake8_simplify/rules/needless_bool.rs +++ b/crates/ruff_linter/src/rules/flake8_simplify/rules/needless_bool.rs @@ -72,7 +72,7 @@ impl Violation for NeedlessBool { if let Some(condition) = condition.as_ref().and_then(SourceCodeSnippet::full_display) { Some(format!("Replace with `return {condition}`")) } else { - Some(format!("Inline condition")) + Some("Inline condition".to_string()) } } } diff --git a/crates/ruff_linter/src/rules/flake8_type_checking/rules/empty_type_checking_block.rs b/crates/ruff_linter/src/rules/flake8_type_checking/rules/empty_type_checking_block.rs index 23d97b5c2d..642f30dede 100644 --- a/crates/ruff_linter/src/rules/flake8_type_checking/rules/empty_type_checking_block.rs +++ b/crates/ruff_linter/src/rules/flake8_type_checking/rules/empty_type_checking_block.rs @@ -42,7 +42,7 @@ impl AlwaysFixableViolation for EmptyTypeCheckingBlock { } fn fix_title(&self) -> String { - format!("Delete empty type-checking block") + "Delete empty type-checking block".to_string() } } diff --git a/crates/ruff_linter/src/rules/flynt/rules/static_join_to_fstring.rs b/crates/ruff_linter/src/rules/flynt/rules/static_join_to_fstring.rs index f3ba8369ca..2f2e5c06e3 100644 --- a/crates/ruff_linter/src/rules/flynt/rules/static_join_to_fstring.rs +++ b/crates/ruff_linter/src/rules/flynt/rules/static_join_to_fstring.rs @@ -51,7 +51,7 @@ impl AlwaysFixableViolation for StaticJoinToFString { if let Some(expression) = expression.full_display() { format!("Replace with `{expression}`") } else { - format!("Replace with f-string") + "Replace with f-string".to_string() } } } diff --git a/crates/ruff_linter/src/rules/perflint/rules/unnecessary_list_cast.rs b/crates/ruff_linter/src/rules/perflint/rules/unnecessary_list_cast.rs index d3fae55e3d..931f2a71fc 100644 --- a/crates/ruff_linter/src/rules/perflint/rules/unnecessary_list_cast.rs +++ b/crates/ruff_linter/src/rules/perflint/rules/unnecessary_list_cast.rs @@ -45,7 +45,7 @@ impl AlwaysFixableViolation for UnnecessaryListCast { } fn fix_title(&self) -> String { - format!("Remove `list()` cast") + "Remove `list()` cast".to_string() } } diff --git a/crates/ruff_linter/src/rules/pycodestyle/rules/invalid_escape_sequence.rs b/crates/ruff_linter/src/rules/pycodestyle/rules/invalid_escape_sequence.rs index d6ecc94b99..5d34eaf79d 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/rules/invalid_escape_sequence.rs +++ b/crates/ruff_linter/src/rules/pycodestyle/rules/invalid_escape_sequence.rs @@ -52,8 +52,8 @@ impl AlwaysFixableViolation for InvalidEscapeSequence { fn fix_title(&self) -> String { match self.fix_title { - FixTitle::AddBackslash => format!("Add backslash to escape sequence"), - FixTitle::UseRawStringLiteral => format!("Use a raw string literal"), + FixTitle::AddBackslash => "Add backslash to escape sequence".to_string(), + FixTitle::UseRawStringLiteral => "Use a raw string literal".to_string(), } } } diff --git a/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/missing_whitespace.rs b/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/missing_whitespace.rs index 0d714b5e88..0e1b13f52d 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/missing_whitespace.rs +++ b/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/missing_whitespace.rs @@ -35,7 +35,7 @@ impl AlwaysFixableViolation for MissingWhitespace { } fn fix_title(&self) -> String { - format!("Add missing whitespace") + "Add missing whitespace".to_string() } } diff --git a/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/missing_whitespace_after_keyword.rs b/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/missing_whitespace_after_keyword.rs index a83ca53e66..e708f2739a 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/missing_whitespace_after_keyword.rs +++ b/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/missing_whitespace_after_keyword.rs @@ -36,7 +36,7 @@ impl AlwaysFixableViolation for MissingWhitespaceAfterKeyword { } fn fix_title(&self) -> String { - format!("Added missing whitespace after keyword") + "Added missing whitespace after keyword".to_string() } } diff --git a/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/missing_whitespace_around_operator.rs b/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/missing_whitespace_around_operator.rs index 1f3236e315..0bc83e079f 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/missing_whitespace_around_operator.rs +++ b/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/missing_whitespace_around_operator.rs @@ -38,7 +38,7 @@ impl AlwaysFixableViolation for MissingWhitespaceAroundOperator { } fn fix_title(&self) -> String { - format!("Add missing whitespace") + "Add missing whitespace".to_string() } } diff --git a/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/space_around_operator.rs b/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/space_around_operator.rs index a707d2fb4b..dfdea60fc3 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/space_around_operator.rs +++ b/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/space_around_operator.rs @@ -35,7 +35,7 @@ impl AlwaysFixableViolation for TabBeforeOperator { } fn fix_title(&self) -> String { - format!("Replace with single space") + "Replace with single space".to_string() } } diff --git a/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/whitespace_around_keywords.rs b/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/whitespace_around_keywords.rs index 365060f41d..f268d59804 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/whitespace_around_keywords.rs +++ b/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/whitespace_around_keywords.rs @@ -31,7 +31,7 @@ impl AlwaysFixableViolation for MultipleSpacesAfterKeyword { } fn fix_title(&self) -> String { - format!("Replace with single space") + "Replace with single space".to_string() } } diff --git a/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/whitespace_around_named_parameter_equals.rs b/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/whitespace_around_named_parameter_equals.rs index c9fd76e15b..07bb86eea7 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/whitespace_around_named_parameter_equals.rs +++ b/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/whitespace_around_named_parameter_equals.rs @@ -41,7 +41,7 @@ impl AlwaysFixableViolation for UnexpectedSpacesAroundKeywordParameterEquals { } fn fix_title(&self) -> String { - format!("Remove whitespace") + "Remove whitespace".to_string() } } diff --git a/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/whitespace_before_comment.rs b/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/whitespace_before_comment.rs index 19cfa0736d..46aeefd44e 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/whitespace_before_comment.rs +++ b/crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/whitespace_before_comment.rs @@ -40,7 +40,7 @@ impl AlwaysFixableViolation for TooFewSpacesBeforeInlineComment { } fn fix_title(&self) -> String { - format!("Insert spaces") + "Insert spaces".to_string() } } diff --git a/crates/ruff_linter/src/rules/pycodestyle/rules/multiple_imports_on_one_line.rs b/crates/ruff_linter/src/rules/pycodestyle/rules/multiple_imports_on_one_line.rs index 85193ed1b9..66e4e9950b 100644 --- a/crates/ruff_linter/src/rules/pycodestyle/rules/multiple_imports_on_one_line.rs +++ b/crates/ruff_linter/src/rules/pycodestyle/rules/multiple_imports_on_one_line.rs @@ -42,7 +42,7 @@ impl Violation for MultipleImportsOnOneLine { } fn fix_title(&self) -> Option { - Some(format!("Split imports")) + Some("Split imports".to_string()) } } diff --git a/crates/ruff_linter/src/rules/pydoclint/rules/check_docstring.rs b/crates/ruff_linter/src/rules/pydoclint/rules/check_docstring.rs index 1f75dbcb4b..4060ac874d 100644 --- a/crates/ruff_linter/src/rules/pydoclint/rules/check_docstring.rs +++ b/crates/ruff_linter/src/rules/pydoclint/rules/check_docstring.rs @@ -65,7 +65,7 @@ impl Violation for DocstringMissingReturns { } fn fix_title(&self) -> Option { - Some(format!("Add a \"Returns\" section to the docstring")) + Some("Add a \"Returns\" section to the docstring".to_string()) } } diff --git a/crates/ruff_linter/src/rules/pydocstyle/rules/triple_quotes.rs b/crates/ruff_linter/src/rules/pydocstyle/rules/triple_quotes.rs index 6504771099..62c64c99c4 100644 --- a/crates/ruff_linter/src/rules/pydocstyle/rules/triple_quotes.rs +++ b/crates/ruff_linter/src/rules/pydocstyle/rules/triple_quotes.rs @@ -55,11 +55,11 @@ impl Violation for TripleSingleQuotes { } fn fix_title(&self) -> Option { - let TripleSingleQuotes { expected_quote } = self; - Some(match expected_quote { - Quote::Double => format!("Convert to triple double quotes"), - Quote::Single => format!("Convert to triple single quotes"), - }) + let title = match self.expected_quote { + Quote::Double => "Convert to triple double quotes", + Quote::Single => "Convert to triple single quotes", + }; + Some(title.to_string()) } } diff --git a/crates/ruff_linter/src/rules/pyflakes/rules/repeated_keys.rs b/crates/ruff_linter/src/rules/pyflakes/rules/repeated_keys.rs index 8aa757ae83..808346048e 100644 --- a/crates/ruff_linter/src/rules/pyflakes/rules/repeated_keys.rs +++ b/crates/ruff_linter/src/rules/pyflakes/rules/repeated_keys.rs @@ -72,12 +72,11 @@ impl Violation for MultiValueRepeatedKeyLiteral { } fn fix_title(&self) -> Option { - let MultiValueRepeatedKeyLiteral { name, .. } = self; - if let Some(name) = name.full_display() { - Some(format!("Remove repeated key literal `{name}`")) - } else { - Some(format!("Remove repeated key literal")) - } + let title = match self.name.full_display() { + Some(name) => format!("Remove repeated key literal `{name}`"), + None => "Remove repeated key literal".to_string(), + }; + Some(title) } } @@ -129,12 +128,11 @@ impl Violation for MultiValueRepeatedKeyVariable { } fn fix_title(&self) -> Option { - let MultiValueRepeatedKeyVariable { name } = self; - if let Some(name) = name.full_display() { - Some(format!("Remove repeated key `{name}`")) - } else { - Some(format!("Remove repeated key")) - } + let title = match self.name.full_display() { + Some(name) => format!("Remove repeated key `{name}`"), + None => "Remove repeated key".to_string(), + }; + Some(title) } } diff --git a/crates/ruff_linter/src/rules/pygrep_hooks/rules/deprecated_log_warn.rs b/crates/ruff_linter/src/rules/pygrep_hooks/rules/deprecated_log_warn.rs index ec97544144..ee736baa2d 100644 --- a/crates/ruff_linter/src/rules/pygrep_hooks/rules/deprecated_log_warn.rs +++ b/crates/ruff_linter/src/rules/pygrep_hooks/rules/deprecated_log_warn.rs @@ -45,6 +45,6 @@ impl Violation for DeprecatedLogWarn { } fn fix_title(&self) -> Option { - Some(format!("Replace with `warning`")) + Some("Replace with `warning`".to_string()) } } diff --git a/crates/ruff_linter/src/rules/pylint/rules/dict_iter_missing_items.rs b/crates/ruff_linter/src/rules/pylint/rules/dict_iter_missing_items.rs index 1fa2fe15d9..17b596c5c2 100644 --- a/crates/ruff_linter/src/rules/pylint/rules/dict_iter_missing_items.rs +++ b/crates/ruff_linter/src/rules/pylint/rules/dict_iter_missing_items.rs @@ -59,7 +59,7 @@ impl AlwaysFixableViolation for DictIterMissingItems { } fn fix_title(&self) -> String { - format!("Add a call to `.items()`") + "Add a call to `.items()`".to_string() } } diff --git a/crates/ruff_linter/src/rules/pylint/rules/empty_comment.rs b/crates/ruff_linter/src/rules/pylint/rules/empty_comment.rs index 873d6c9096..7ea1860c4d 100644 --- a/crates/ruff_linter/src/rules/pylint/rules/empty_comment.rs +++ b/crates/ruff_linter/src/rules/pylint/rules/empty_comment.rs @@ -39,7 +39,7 @@ impl Violation for EmptyComment { } fn fix_title(&self) -> Option { - Some(format!("Delete the empty comment")) + Some("Delete the empty comment".to_string()) } } diff --git a/crates/ruff_linter/src/rules/pylint/rules/iteration_over_set.rs b/crates/ruff_linter/src/rules/pylint/rules/iteration_over_set.rs index 9b37135517..915817c4d8 100644 --- a/crates/ruff_linter/src/rules/pylint/rules/iteration_over_set.rs +++ b/crates/ruff_linter/src/rules/pylint/rules/iteration_over_set.rs @@ -40,7 +40,7 @@ impl AlwaysFixableViolation for IterationOverSet { } fn fix_title(&self) -> String { - format!("Convert to `tuple`") + "Convert to `tuple`".to_string() } } diff --git a/crates/ruff_linter/src/rules/pylint/rules/literal_membership.rs b/crates/ruff_linter/src/rules/pylint/rules/literal_membership.rs index 7d0031ab06..cd198287b0 100644 --- a/crates/ruff_linter/src/rules/pylint/rules/literal_membership.rs +++ b/crates/ruff_linter/src/rules/pylint/rules/literal_membership.rs @@ -41,7 +41,7 @@ impl AlwaysFixableViolation for LiteralMembership { } fn fix_title(&self) -> String { - format!("Convert to `set`") + "Convert to `set`".to_string() } } diff --git a/crates/ruff_linter/src/rules/pylint/rules/no_method_decorator.rs b/crates/ruff_linter/src/rules/pylint/rules/no_method_decorator.rs index dc01fb788f..32d6762d25 100644 --- a/crates/ruff_linter/src/rules/pylint/rules/no_method_decorator.rs +++ b/crates/ruff_linter/src/rules/pylint/rules/no_method_decorator.rs @@ -42,7 +42,7 @@ impl AlwaysFixableViolation for NoClassmethodDecorator { } fn fix_title(&self) -> String { - format!("Add @classmethod decorator") + "Add @classmethod decorator".to_string() } } diff --git a/crates/ruff_linter/src/rules/pylint/rules/repeated_equality_comparison.rs b/crates/ruff_linter/src/rules/pylint/rules/repeated_equality_comparison.rs index ffe885d9a3..48a842b954 100644 --- a/crates/ruff_linter/src/rules/pylint/rules/repeated_equality_comparison.rs +++ b/crates/ruff_linter/src/rules/pylint/rules/repeated_equality_comparison.rs @@ -63,7 +63,7 @@ impl AlwaysFixableViolation for RepeatedEqualityComparison { } fn fix_title(&self) -> String { - format!("Merge multiple comparisons") + "Merge multiple comparisons".to_string() } } diff --git a/crates/ruff_linter/src/rules/pylint/rules/repeated_isinstance_calls.rs b/crates/ruff_linter/src/rules/pylint/rules/repeated_isinstance_calls.rs index d628461836..4548a60641 100644 --- a/crates/ruff_linter/src/rules/pylint/rules/repeated_isinstance_calls.rs +++ b/crates/ruff_linter/src/rules/pylint/rules/repeated_isinstance_calls.rs @@ -70,7 +70,7 @@ impl AlwaysFixableViolation for RepeatedIsinstanceCalls { if let Some(expression) = expression.full_display() { format!("Replace with `{expression}`") } else { - format!("Replace with merged `isinstance` call") + "Replace with merged `isinstance` call".to_string() } } } diff --git a/crates/ruff_linter/src/rules/pylint/rules/unnecessary_dict_index_lookup.rs b/crates/ruff_linter/src/rules/pylint/rules/unnecessary_dict_index_lookup.rs index f6929ae9dc..721bf378b7 100644 --- a/crates/ruff_linter/src/rules/pylint/rules/unnecessary_dict_index_lookup.rs +++ b/crates/ruff_linter/src/rules/pylint/rules/unnecessary_dict_index_lookup.rs @@ -40,7 +40,7 @@ impl AlwaysFixableViolation for UnnecessaryDictIndexLookup { } fn fix_title(&self) -> String { - format!("Use existing variable") + "Use existing variable".to_string() } } diff --git a/crates/ruff_linter/src/rules/pylint/rules/unnecessary_list_index_lookup.rs b/crates/ruff_linter/src/rules/pylint/rules/unnecessary_list_index_lookup.rs index 21540b1655..58bda2871e 100644 --- a/crates/ruff_linter/src/rules/pylint/rules/unnecessary_list_index_lookup.rs +++ b/crates/ruff_linter/src/rules/pylint/rules/unnecessary_list_index_lookup.rs @@ -41,7 +41,7 @@ impl AlwaysFixableViolation for UnnecessaryListIndexLookup { } fn fix_title(&self) -> String { - format!("Use the loop variable directly") + "Use the loop variable directly".to_string() } } diff --git a/crates/ruff_linter/src/rules/pylint/rules/unspecified_encoding.rs b/crates/ruff_linter/src/rules/pylint/rules/unspecified_encoding.rs index a8a5ac69f6..377f872125 100644 --- a/crates/ruff_linter/src/rules/pylint/rules/unspecified_encoding.rs +++ b/crates/ruff_linter/src/rules/pylint/rules/unspecified_encoding.rs @@ -67,7 +67,7 @@ impl AlwaysFixableViolation for UnspecifiedEncoding { } fn fix_title(&self) -> String { - format!("Add explicit `encoding` argument") + "Add explicit `encoding` argument".to_string() } } diff --git a/crates/ruff_linter/src/rules/pylint/rules/useless_exception_statement.rs b/crates/ruff_linter/src/rules/pylint/rules/useless_exception_statement.rs index 52ec3af23d..15e21b14e5 100644 --- a/crates/ruff_linter/src/rules/pylint/rules/useless_exception_statement.rs +++ b/crates/ruff_linter/src/rules/pylint/rules/useless_exception_statement.rs @@ -45,7 +45,7 @@ impl Violation for UselessExceptionStatement { } fn fix_title(&self) -> Option { - Some(format!("Add `raise` keyword")) + Some("Add `raise` keyword".to_string()) } } diff --git a/crates/ruff_linter/src/rules/pylint/rules/useless_return.rs b/crates/ruff_linter/src/rules/pylint/rules/useless_return.rs index 6d51bbd4e0..c890a8768b 100644 --- a/crates/ruff_linter/src/rules/pylint/rules/useless_return.rs +++ b/crates/ruff_linter/src/rules/pylint/rules/useless_return.rs @@ -38,7 +38,7 @@ impl AlwaysFixableViolation for UselessReturn { } fn fix_title(&self) -> String { - format!("Remove useless `return` statement") + "Remove useless `return` statement".to_string() } } diff --git a/crates/ruff_linter/src/rules/pyupgrade/rules/unnecessary_default_type_args.rs b/crates/ruff_linter/src/rules/pyupgrade/rules/unnecessary_default_type_args.rs index 4ef77fbc30..a10a316b03 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/rules/unnecessary_default_type_args.rs +++ b/crates/ruff_linter/src/rules/pyupgrade/rules/unnecessary_default_type_args.rs @@ -60,7 +60,7 @@ impl AlwaysFixableViolation for UnnecessaryDefaultTypeArgs { } fn fix_title(&self) -> String { - format!("Remove default type arguments") + "Remove default type arguments".to_string() } } diff --git a/crates/ruff_linter/src/rules/refurb/rules/bit_count.rs b/crates/ruff_linter/src/rules/refurb/rules/bit_count.rs index 35f85b3c56..74daeb5085 100644 --- a/crates/ruff_linter/src/rules/refurb/rules/bit_count.rs +++ b/crates/ruff_linter/src/rules/refurb/rules/bit_count.rs @@ -50,7 +50,7 @@ impl AlwaysFixableViolation for BitCount { if let Some(replacement) = replacement.full_display() { format!("Replace with `{replacement}`") } else { - format!("Replace with `.bit_count()`") + "Replace with `.bit_count()`".to_string() } } } diff --git a/crates/ruff_linter/src/rules/refurb/rules/fstring_number_format.rs b/crates/ruff_linter/src/rules/refurb/rules/fstring_number_format.rs index 11f0573969..096fc1364e 100644 --- a/crates/ruff_linter/src/rules/refurb/rules/fstring_number_format.rs +++ b/crates/ruff_linter/src/rules/refurb/rules/fstring_number_format.rs @@ -49,14 +49,14 @@ impl Violation for FStringNumberFormat { } fn fix_title(&self) -> Option { - let FStringNumberFormat { replacement, .. } = self; - if let Some(display) = replacement + if let Some(display) = self + .replacement .as_ref() .and_then(SourceCodeSnippet::full_display) { Some(format!("Replace with `{display}`")) } else { - Some(format!("Replace with f-string")) + Some("Replace with f-string".to_string()) } } } diff --git a/crates/ruff_linter/src/rules/refurb/rules/if_exp_instead_of_or_operator.rs b/crates/ruff_linter/src/rules/refurb/rules/if_exp_instead_of_or_operator.rs index 4b09aa6ebb..a220d7a1e1 100644 --- a/crates/ruff_linter/src/rules/refurb/rules/if_exp_instead_of_or_operator.rs +++ b/crates/ruff_linter/src/rules/refurb/rules/if_exp_instead_of_or_operator.rs @@ -50,7 +50,7 @@ impl Violation for IfExpInsteadOfOrOperator { } fn fix_title(&self) -> Option { - Some(format!("Replace with `or` operator")) + Some("Replace with `or` operator".to_string()) } } diff --git a/crates/ruff_linter/src/rules/refurb/rules/int_on_sliced_str.rs b/crates/ruff_linter/src/rules/refurb/rules/int_on_sliced_str.rs index a27e969381..630508d153 100644 --- a/crates/ruff_linter/src/rules/refurb/rules/int_on_sliced_str.rs +++ b/crates/ruff_linter/src/rules/refurb/rules/int_on_sliced_str.rs @@ -60,7 +60,7 @@ impl AlwaysFixableViolation for IntOnSlicedStr { } fn fix_title(&self) -> String { - format!("Replace with `base=0`") + "Replace with `base=0`".to_string() } } diff --git a/crates/ruff_linter/src/rules/refurb/rules/metaclass_abcmeta.rs b/crates/ruff_linter/src/rules/refurb/rules/metaclass_abcmeta.rs index 5982cdca7f..557258f091 100644 --- a/crates/ruff_linter/src/rules/refurb/rules/metaclass_abcmeta.rs +++ b/crates/ruff_linter/src/rules/refurb/rules/metaclass_abcmeta.rs @@ -44,7 +44,7 @@ impl AlwaysFixableViolation for MetaClassABCMeta { } fn fix_title(&self) -> String { - format!("Replace with `abc.ABC`") + "Replace with `abc.ABC`".to_string() } } diff --git a/crates/ruff_linter/src/rules/refurb/rules/reimplemented_starmap.rs b/crates/ruff_linter/src/rules/refurb/rules/reimplemented_starmap.rs index 8c92005e19..202ca4fff2 100644 --- a/crates/ruff_linter/src/rules/refurb/rules/reimplemented_starmap.rs +++ b/crates/ruff_linter/src/rules/refurb/rules/reimplemented_starmap.rs @@ -76,7 +76,7 @@ impl Violation for ReimplementedStarmap { } fn fix_title(&self) -> Option { - Some(format!("Replace with `itertools.starmap`")) + Some("Replace with `itertools.starmap`".to_string()) } } diff --git a/crates/ruff_linter/src/rules/ruff/rules/collection_literal_concatenation.rs b/crates/ruff_linter/src/rules/ruff/rules/collection_literal_concatenation.rs index 0689a2957a..255edf75cc 100644 --- a/crates/ruff_linter/src/rules/ruff/rules/collection_literal_concatenation.rs +++ b/crates/ruff_linter/src/rules/ruff/rules/collection_literal_concatenation.rs @@ -55,12 +55,11 @@ impl Violation for CollectionLiteralConcatenation { } fn fix_title(&self) -> Option { - let CollectionLiteralConcatenation { expression } = self; - if let Some(expression) = expression.full_display() { - Some(format!("Replace with `{expression}`")) - } else { - Some(format!("Replace with iterable unpacking")) - } + let title = match self.expression.full_display() { + Some(expression) => format!("Replace with `{expression}`"), + None => "Replace with iterable unpacking".to_string(), + }; + Some(title) } } diff --git a/crates/ruff_linter/src/rules/ruff/rules/invalid_formatter_suppression_comment.rs b/crates/ruff_linter/src/rules/ruff/rules/invalid_formatter_suppression_comment.rs index 7b6f1d1856..63c2b2468a 100644 --- a/crates/ruff_linter/src/rules/ruff/rules/invalid_formatter_suppression_comment.rs +++ b/crates/ruff_linter/src/rules/ruff/rules/invalid_formatter_suppression_comment.rs @@ -64,7 +64,7 @@ impl AlwaysFixableViolation for InvalidFormatterSuppressionComment { } fn fix_title(&self) -> String { - format!("Remove this comment") + "Remove this comment".to_string() } } diff --git a/crates/ruff_linter/src/rules/ruff/rules/post_init_default.rs b/crates/ruff_linter/src/rules/ruff/rules/post_init_default.rs index 61a321b6e1..7632fd18a0 100644 --- a/crates/ruff_linter/src/rules/ruff/rules/post_init_default.rs +++ b/crates/ruff_linter/src/rules/ruff/rules/post_init_default.rs @@ -78,7 +78,7 @@ impl Violation for PostInitDefault { } fn fix_title(&self) -> Option { - Some(format!("Use `dataclasses.InitVar` instead")) + Some("Use `dataclasses.InitVar` instead".to_string()) } } diff --git a/crates/ruff_linter/src/rules/ruff/rules/quadratic_list_summation.rs b/crates/ruff_linter/src/rules/ruff/rules/quadratic_list_summation.rs index 31b4396a2a..53794388fd 100644 --- a/crates/ruff_linter/src/rules/ruff/rules/quadratic_list_summation.rs +++ b/crates/ruff_linter/src/rules/ruff/rules/quadratic_list_summation.rs @@ -62,7 +62,7 @@ impl AlwaysFixableViolation for QuadraticListSummation { } fn fix_title(&self) -> String { - format!("Replace with `functools.reduce`") + "Replace with `functools.reduce`".to_string() } } diff --git a/crates/ruff_linter/src/rules/ruff/rules/unnecessary_key_check.rs b/crates/ruff_linter/src/rules/ruff/rules/unnecessary_key_check.rs index bd939d354a..d8084fb8c6 100644 --- a/crates/ruff_linter/src/rules/ruff/rules/unnecessary_key_check.rs +++ b/crates/ruff_linter/src/rules/ruff/rules/unnecessary_key_check.rs @@ -38,7 +38,7 @@ impl AlwaysFixableViolation for UnnecessaryKeyCheck { } fn fix_title(&self) -> String { - format!("Replace with `dict.get`") + "Replace with `dict.get`".to_string() } } diff --git a/crates/ruff_linter/src/rules/tryceratops/rules/error_instead_of_exception.rs b/crates/ruff_linter/src/rules/tryceratops/rules/error_instead_of_exception.rs index b98c71452a..8d3378c6bd 100644 --- a/crates/ruff_linter/src/rules/tryceratops/rules/error_instead_of_exception.rs +++ b/crates/ruff_linter/src/rules/tryceratops/rules/error_instead_of_exception.rs @@ -63,7 +63,7 @@ impl Violation for ErrorInsteadOfException { } fn fix_title(&self) -> Option { - Some(format!("Replace with `exception`")) + Some("Replace with `exception`".to_string()) } } diff --git a/crates/ruff_linter/src/rules/tryceratops/rules/verbose_raise.rs b/crates/ruff_linter/src/rules/tryceratops/rules/verbose_raise.rs index 132459592c..72a5a9c01f 100644 --- a/crates/ruff_linter/src/rules/tryceratops/rules/verbose_raise.rs +++ b/crates/ruff_linter/src/rules/tryceratops/rules/verbose_raise.rs @@ -45,7 +45,7 @@ impl AlwaysFixableViolation for VerboseRaise { } fn fix_title(&self) -> String { - format!("Remove exception name") + "Remove exception name".to_string() } }