mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
update thin-vec
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
use rustc_ast::{self as ast, DUMMY_NODE_ID, Mutability, Pat, PatKind, Pinnedness};
|
||||
use rustc_ast_pretty::pprust;
|
||||
use rustc_data_structures::thin_vec::{ThinVec, thin_vec};
|
||||
use rustc_data_structures::thinvec::ExtractIf;
|
||||
use rustc_errors::Applicability;
|
||||
use rustc_lint::{EarlyContext, EarlyLintPass};
|
||||
use rustc_session::impl_lint_pass;
|
||||
@@ -422,9 +421,7 @@ fn drain_matching(
|
||||
let mut tail_or = ThinVec::new();
|
||||
let mut idx = 0;
|
||||
|
||||
// FIXME: once `thin-vec` releases a new version, change this to `alternatives.extract_if()`
|
||||
// See https://github.com/mozilla/thin-vec/issues/77
|
||||
for pat in ExtractIf::new(alternatives, |p| {
|
||||
for pat in alternatives.extract_if(.., |p| {
|
||||
// Check if we should extract, but only if `idx >= start`.
|
||||
idx += 1;
|
||||
idx > start && predicate(&p.kind)
|
||||
|
||||
Reference in New Issue
Block a user