mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-30 15:17:59 +00:00
Remove misleading emoji comment
This commit is contained in:
parent
f40ae943a7
commit
07b5bf7030
1 changed files with 4 additions and 3 deletions
|
@ -1,11 +1,12 @@
|
|||
use once_cell::sync::Lazy;
|
||||
use regex::{Captures, Regex};
|
||||
|
||||
static CURLY_ESCAPE: Lazy<Regex> = Lazy::new(|| Regex::new(r"(\\N\{[^}]+})|([{}])").unwrap());
|
||||
static CURLY_BRACES: Lazy<Regex> = 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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue