[−][src]Function bisection::bisect_right_slice
pub fn bisect_right_slice<T, I>(a: &[T], x: &T, within: I) -> usize where
I: RangeBounds<usize>,
T: Ord,
Return the index where x
should be inserted in a[within]
, assuming a
is sorted.
The return value i
is such that all e
in a[..i]
have e <= x
, and
all e
in a[i..]
have e > x
.
- If
a
containsx
,a.insert(i, x)
will insert just after the rightmostx
.
Panics
Panics if within
is out of bounds of a
.