Merge commit 'a5d597637dcb78dc73f93561ce474f23d4177c35' into clippyup

This commit is contained in:
flip1995
2021-12-06 12:33:31 +01:00
parent 35a0060aba
commit 8fea1d94f3
491 changed files with 9888 additions and 3255 deletions

View File

@@ -66,7 +66,13 @@ pub(super) fn get_hint_if_single_char_arg(
// for regular string: "a"
&snip[1..(snip.len() - 1)]
};
let hint = format!("'{}'", if ch == "'" { "\\'" } else { ch });
let hint = format!("'{}'", match ch {
"'" => "\\'" ,
r"\" => "\\\\",
_ => ch,
});
Some(hint)
} else {
None