diff options
| author | mo8it <mo8it@proton.me> | 2024-08-22 14:41:25 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-08-22 14:41:25 +0200 |
| commit | f1abd8577c824eac4eb152a4b0789ce23642ba62 (patch) | |
| tree | 543b9569480abfd1b33a4e9536436f02d90dd7bc /solutions/09_strings/strings4.rs | |
| parent | 423b50b068f7cb489e4c5f241b696491419620c1 (diff) | |
Add missing Clippy allows to solutions
Diffstat (limited to 'solutions/09_strings/strings4.rs')
| -rw-r--r-- | solutions/09_strings/strings4.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/solutions/09_strings/strings4.rs b/solutions/09_strings/strings4.rs index fe4733e..3c69b97 100644 --- a/solutions/09_strings/strings4.rs +++ b/solutions/09_strings/strings4.rs @@ -18,12 +18,11 @@ fn main() { // Here, both answers work. // `.into()` converts a type into an expected type. // If it is called where `String` is expected, it will convert `&str` to `String`. - // But if is called where `&str` is expected, then `&str` is kept `&str` since no - // conversion is needed. string("nice weather".into()); + // But if it is called where `&str` is expected, then `&str` is kept `&str` since no conversion is needed. + // If you remove the `#[allow(…)]` line, then Clippy will tell you to remove `.into()` below since it is a useless conversion. + #[allow(clippy::useless_conversion)] string_slice("nice weather".into()); - // ^^^^^^^ the compiler recommends removing the `.into()` - // call because it is a useless conversion. string(format!("Interpolation {}", "Station")); |
