diff options
| author | Samarth1696 <samarthrobo03@gmail.com> | 2024-07-26 17:46:41 +0530 |
|---|---|---|
| committer | Samarth1696 <samarthrobo03@gmail.com> | 2024-09-07 13:21:14 +0530 |
| commit | 6f01273d5d2acec2a726f2115fbf557967c2336a (patch) | |
| tree | b2caa7e55f0b2af00f8d16a94d829316ddd5da67 | |
| parent | 73039f654e2efc3a7384462dcd46289851b80e62 (diff) | |
| download | rust-6f01273d5d2acec2a726f2115fbf557967c2336a.tar.gz rust-6f01273d5d2acec2a726f2115fbf557967c2336a.zip | |
dogfood test passed
| -rw-r--r-- | clippy_lints/src/non_zero_suggestions.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/clippy_lints/src/non_zero_suggestions.rs b/clippy_lints/src/non_zero_suggestions.rs index 715d9eda6ee..e652f6f5108 100644 --- a/clippy_lints/src/non_zero_suggestions.rs +++ b/clippy_lints/src/non_zero_suggestions.rs @@ -87,15 +87,12 @@ fn suggest_non_zero_conversion( target_non_zero_type: &str, arg_snippet: &str, ) { - let suggestion = format!("{}::{}({})", target_non_zero_type, fn_name, arg_snippet); + let suggestion = format!("{target_non_zero_type}::{fn_name}({arg_snippet})"); span_lint_and_sugg( cx, NON_ZERO_SUGGESTIONS, expr.span, - format!( - "Consider using `{}::{}()` for more efficient and type-safe conversion", - target_non_zero_type, fn_name - ), + format!("Consider using `{target_non_zero_type}::{fn_name}()` for more efficient and type-safe conversion"), "Replace with", suggestion, Applicability::MachineApplicable, |
