-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #8067 - frobiac:8060-backslash_escaped_in_single_char_p…
…attern, r=giraffate Escape backslash in single_char_pattern.rs Escape backslash in single_char_pattern. Previously, the proposed clippy fix for a single backslash in raw strings ```r"\"``` or ```r#"\"#``` was also only an unescaped, *single* ```'\'```: ```shell warning: single-character string constant used as pattern 2 | let s = r#"abc\xyz/"#.find(r"\"); | ^^^^ help: try using a `char` instead: `'\'` | = note: `#[warn(clippy::single_char_pattern)]` on by default ``` This PR corrects this to a properly escaped *double* backslash ```'\\'```. I haven't come up with any other problematic cases, a single quote was already handled. Closes: #8060 changelog: Escape backslash in ``[`single_char_pattern`]``
- Loading branch information
Showing
4 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters