Apply nightly clippy lints (#9654)

# Description
- A new one is the removal of unnecessary `#` in raw strings without `"`
inside.
-
https://rust-lang.github.io/rust-clippy/master/index.html#/needless_raw_string_hashes
- The automatically applied removal of `.into_iter()` touched several
places where #9648 will change to the use of the record API. If
necessary I can remove them @IanManske to avoid churn with this PR.
- Manually applied `.try_fold` in two places
- Removed a dead `if`
- Manual: Combat rightward-drift with early return
This commit is contained in:
Stefan Holderbach
2023-07-12 00:00:31 +02:00
committed by GitHub
parent ad11e25fc5
commit bd0032898f
20 changed files with 49 additions and 63 deletions

View File

@ -128,12 +128,12 @@ impl Command for SubCommand {
},
Example {
description: "Find and replace contents without using the replace parameter as a regular expression",
example: r#"'dogs_$1_cats' | str replace '\$1' '$2' -n"#,
example: r"'dogs_$1_cats' | str replace '\$1' '$2' -n",
result: Some(Value::test_string("dogs_$2_cats")),
},
Example {
description: "Find and replace the first occurrence using string replacement *not* regular expressions",
example: r#"'c:\some\cool\path' | str replace 'c:\some\cool' '~' -s"#,
example: r"'c:\some\cool\path' | str replace 'c:\some\cool' '~' -s",
result: Some(Value::test_string("~\\path")),
},
Example {
@ -148,7 +148,7 @@ impl Command for SubCommand {
},
Example {
description: "Find and replace with fancy-regex",
example: r#"'a successful b' | str replace '\b([sS])uc(?:cs|s?)e(ed(?:ed|ing|s?)|ss(?:es|ful(?:ly)?|i(?:ons?|ve(?:ly)?)|ors?)?)\b' '${1}ucce$2'"#,
example: r"'a successful b' | str replace '\b([sS])uc(?:cs|s?)e(ed(?:ed|ing|s?)|ss(?:es|ful(?:ly)?|i(?:ons?|ve(?:ly)?)|ors?)?)\b' '${1}ucce$2'",
result: Some(Value::test_string("a successful b")),
},
Example {