1
Fork 0

Rollup merge of #133265 - the8472:extract-if-ranges, r=cuviper

Add a range argument to vec.extract_if

tracking issue: #43244

This adds the range argument requested in https://github.com/rust-lang/rust/issues/43244#issuecomment-2486160659
This commit is contained in:
Matthias Krüger 2024-12-17 22:34:40 +01:00 committed by GitHub
commit 938742e687
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 105 additions and 72 deletions

View file

@ -205,7 +205,7 @@ impl EarlyLintPass for NonAsciiIdents {
(IdentifierType::Not_NFKC, "Not_NFKC"),
] {
let codepoints: Vec<_> =
chars.extract_if(|(_, ty)| *ty == Some(id_ty)).collect();
chars.extract_if(.., |(_, ty)| *ty == Some(id_ty)).collect();
if codepoints.is_empty() {
continue;
}
@ -217,7 +217,7 @@ impl EarlyLintPass for NonAsciiIdents {
}
let remaining = chars
.extract_if(|(c, _)| !GeneralSecurityProfile::identifier_allowed(*c))
.extract_if(.., |(c, _)| !GeneralSecurityProfile::identifier_allowed(*c))
.collect::<Vec<_>>();
if !remaining.is_empty() {
cx.emit_span_lint(UNCOMMON_CODEPOINTS, sp, IdentifierUncommonCodepoints {