1
Fork 0

address requested changes

This commit is contained in:
HTGAzureX1212. 2024-01-23 21:16:24 +08:00
parent f3682a1304
commit 3a07333a8a
No known key found for this signature in database
GPG key ID: 89A2F7143673C5B9
7 changed files with 18 additions and 13 deletions

View file

@ -190,15 +190,16 @@ impl EarlyLintPass for NonAsciiIdents {
if check_uncommon_codepoints
&& !symbol_str.chars().all(GeneralSecurityProfile::identifier_allowed)
{
let codepoints: Vec<_> = symbol_str
.chars()
.filter(|c| !GeneralSecurityProfile::identifier_allowed(*c))
.collect();
let codepoints_len = codepoints.len();
cx.emit_span_lint(
UNCOMMON_CODEPOINTS,
sp,
IdentifierUncommonCodepoints {
codepoints: symbol_str
.chars()
.filter(|c| !GeneralSecurityProfile::identifier_allowed(*c))
.collect(),
},
IdentifierUncommonCodepoints { codepoints, codepoints_len },
);
}
}