We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f40ae94 commit 07b5bf7Copy full SHA for 07b5bf7
src/rules/pyupgrade/helpers.rs
@@ -1,11 +1,12 @@
1
use once_cell::sync::Lazy;
2
use regex::{Captures, Regex};
3
4
-static CURLY_ESCAPE: Lazy<Regex> = Lazy::new(|| Regex::new(r"(\\N\{[^}]+})|([{}])").unwrap());
+static CURLY_BRACES: Lazy<Regex> = Lazy::new(|| Regex::new(r"(\\N\{[^}]+})|([{}])").unwrap());
5
6
pub fn curly_escape(text: &str) -> String {
7
- // We don't support emojis right now.
8
- 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.
9
+ CURLY_BRACES
10
.replace_all(text, |caps: &Captures| {
11
if let Some(match_) = caps.get(1) {
12
match_.as_str().to_string()
0 commit comments