Replace Symbol::as_str usage in match expressions

This commit is contained in:
Alex Macleod 2025-05-07 13:52:11 +00:00
parent cf6bebb343
commit 5aac708398
25 changed files with 281 additions and 148 deletions

View file

@ -498,9 +498,9 @@ fn check_literal(cx: &LateContext<'_>, format_args: &FormatArgs, name: &str) {
None => return,
},
LitKind::Char => (
match lit.symbol.as_str() {
"\"" => "\\\"",
"\\'" => "'",
match lit.symbol {
sym::DOUBLE_QUOTE => "\\\"",
sym::BACKSLASH_SINGLE_QUOTE => "'",
_ => match value_string.strip_prefix('\'').and_then(|s| s.strip_suffix('\'')) {
Some(stripped) => stripped,
None => return,