From 07b5bf70304628f46e47c20f8a01c5f93d48f80c Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Sun, 22 Jan 2023 21:22:53 -0500 Subject: [PATCH] Remove misleading emoji comment --- src/rules/pyupgrade/helpers.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/rules/pyupgrade/helpers.rs b/src/rules/pyupgrade/helpers.rs index 99081f8498..6d3cfa8dbb 100644 --- a/src/rules/pyupgrade/helpers.rs +++ b/src/rules/pyupgrade/helpers.rs @@ -1,11 +1,12 @@ use once_cell::sync::Lazy; use regex::{Captures, Regex}; -static CURLY_ESCAPE: Lazy = Lazy::new(|| Regex::new(r"(\\N\{[^}]+})|([{}])").unwrap()); +static CURLY_BRACES: Lazy = Lazy::new(|| Regex::new(r"(\\N\{[^}]+})|([{}])").unwrap()); pub fn curly_escape(text: &str) -> String { - // We don't support emojis right now. - CURLY_ESCAPE + // Match all curly braces. This will include named unicode escapes (like + // \N{SNOWMAN}), which we _don't_ want to escape, so take care to preserve them. + CURLY_BRACES .replace_all(text, |caps: &Captures| { if let Some(match_) = caps.get(1) { match_.as_str().to_string()