Crate partition[][src]

This crate has only one partition(&[T], P) function to partition slices in place.

Functions

partition

partition a mutable slice in-place so that it contains all elements for which predicate(e) is true, followed by all elements for which predicate(e) is false. Returns sub-slices to all predicated and non-predicated elements, respectively.

partition_index

partition a mutable slice in-place so that it contains all elements for which predicate(e) is true, followed by all elements for which predicate(e) is false. Returns the index of the first element which returned false. Returns 0 if all elements returned false. Returns data.len() if all elements returned true.