Skip to content

Commit edd9cf9

Browse files
committed
make suggested modifications
1 parent c9396cc commit edd9cf9

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

compiler/rustc_lint/messages.ftl

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ lint_identifier_non_ascii_char = identifier contains non-ASCII characters
242242
243243
lint_identifier_uncommon_codepoints = identifier contains {$codepoints_len ->
244244
[one] { $identifier_type ->
245-
[Exclusion] a Unicode codepoint that its corresponding script is no longer used
245+
[Exclusion] a Unicode codepoint whose corresponding script is no longer used
246246
[Technical] a Unicode codepoint that has specialized usage
247247
[Limited_Use] a Unicode codepoint that is in limited use
248248
[Not_NFKC] a Unicode codepoint that is not used in normalized strings

compiler/rustc_lint/src/non_ascii_idents.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -221,14 +221,12 @@ impl EarlyLintPass for NonAsciiIdents {
221221
.extract_if(|(c, _)| !GeneralSecurityProfile::identifier_allowed(*c))
222222
.collect::<Vec<_>>();
223223
if !remaining.is_empty() {
224-
let remaining_len = remaining.len();
225-
226224
cx.emit_span_lint(
227225
UNCOMMON_CODEPOINTS,
228226
sp,
229227
IdentifierUncommonCodepoints {
230-
codepoints: remaining.iter().map(|(c, _)| *c).collect(),
231-
codepoints_len: remaining_len,
228+
codepoints_len: remaining.len(),
229+
codepoints: remaining.into_iter().map(|(c, _)| c).collect(),
232230
identifier_type: "Restricted",
233231
},
234232
);

0 commit comments

Comments
 (0)