Expand description
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)
istrue
, followed by all elements for whichpredicate(e)
isfalse
. 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)
istrue
, followed by all elements for whichpredicate(e)
isfalse
. Returns the index of the first element which returned false. Returns 0 if all elements returned false. Returnsdata.len()
if all elements returned true.