Skip to content

Commit 07b5bf7

Browse files
committed
Remove misleading emoji comment
1 parent f40ae94 commit 07b5bf7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/rules/pyupgrade/helpers.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
use once_cell::sync::Lazy;
22
use regex::{Captures, Regex};
33

4-
static CURLY_ESCAPE: Lazy<Regex> = Lazy::new(|| Regex::new(r"(\\N\{[^}]+})|([{}])").unwrap());
4+
static CURLY_BRACES: Lazy<Regex> = Lazy::new(|| Regex::new(r"(\\N\{[^}]+})|([{}])").unwrap());
55

66
pub fn curly_escape(text: &str) -> String {
7-
// We don't support emojis right now.
8-
CURLY_ESCAPE
7+
// Match all curly braces. This will include named unicode escapes (like
8+
// \N{SNOWMAN}), which we _don't_ want to escape, so take care to preserve them.
9+
CURLY_BRACES
910
.replace_all(text, |caps: &Captures| {
1011
if let Some(match_) = caps.get(1) {
1112
match_.as_str().to_string()

0 commit comments

Comments
 (0)