Skip to content

Commit

Permalink
Rm parallel::retain_unordered_mut
Browse files Browse the repository at this point in the history
  • Loading branch information
NobodyXu committed Apr 18, 2024
1 parent eb6ab04 commit 22174dd
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions src/parallel/mod.rs
@@ -1,20 +1,3 @@
pub(crate) mod async_executor;
pub(crate) mod job_token;
pub(crate) mod stderr;

/// Remove all element in `vec` which `f(element)` returns `false`.
///
/// TODO: Remove this once the MSRV is bumped to v1.61
pub(crate) fn retain_unordered_mut<T, F>(vec: &mut Vec<T>, mut f: F)
where
F: FnMut(&mut T) -> bool,
{
let mut i = 0;
while i < vec.len() {
if f(&mut vec[i]) {
i += 1;
} else {
vec.swap_remove(i);
}
}
}

0 comments on commit 22174dd

Please sign in to comment.