Skip to content

Commit 44be1c2

Browse files
vojtechkralm-ou-se
andcommitted
VecDeque: Improve doc comments in binary search fns
Co-authored-by: Mara Bos <[email protected]>
1 parent e68680d commit 44be1c2

File tree

1 file changed

+23
-5
lines changed
  • library/alloc/src/collections/vec_deque

1 file changed

+23
-5
lines changed

library/alloc/src/collections/vec_deque/mod.rs

+23-5
Original file line numberDiff line numberDiff line change
@@ -2403,6 +2403,12 @@ impl<T> VecDeque<T> {
24032403
/// [`Result::Err`] is returned, containing the index where a matching
24042404
/// element could be inserted while maintaining sorted order.
24052405
///
2406+
/// See also [`binary_search_by`], [`binary_search_by_key`], and [`partition_point`].
2407+
///
2408+
/// [`binary_search_by`]: VecDeque::binary_search_by
2409+
/// [`binary_search_by_key`]: VecDeque::binary_search_by_key
2410+
/// [`partition_point`]: VecDeque::partition_point
2411+
///
24062412
/// # Examples
24072413
///
24082414
/// Looks up a series of four elements. The first is found, with a
@@ -2457,6 +2463,12 @@ impl<T> VecDeque<T> {
24572463
/// [`Result::Err`] is returned, containing the index where a matching
24582464
/// element could be inserted while maintaining sorted order.
24592465
///
2466+
/// See also [`binary_search`], [`binary_search_by_key`], and [`partition_point`].
2467+
///
2468+
/// [`binary_search`]: VecDeque::binary_search
2469+
/// [`binary_search_by_key`]: VecDeque::binary_search_by_key
2470+
/// [`partition_point`]: VecDeque::partition_point
2471+
///
24602472
/// # Examples
24612473
///
24622474
/// Looks up a series of four elements. The first is found, with a
@@ -2495,15 +2507,21 @@ impl<T> VecDeque<T> {
24952507
/// Binary searches this sorted `VecDeque` with a key extraction function.
24962508
///
24972509
/// Assumes that the `VecDeque` is sorted by the key, for instance with
2498-
/// [`make_contiguous().sort_by_key()`](#method.make_contiguous) using the same
2499-
/// key extraction function.
2510+
/// [`make_contiguous().sort_by_key()`] using the same key extraction function.
25002511
///
25012512
/// If the value is found then [`Result::Ok`] is returned, containing the
25022513
/// index of the matching element. If there are multiple matches, then any
25032514
/// one of the matches could be returned. If the value is not found then
25042515
/// [`Result::Err`] is returned, containing the index where a matching
25052516
/// element could be inserted while maintaining sorted order.
25062517
///
2518+
/// See also [`binary_search`], [`binary_search_by`], and [`partition_point`].
2519+
///
2520+
/// [`make_contiguous().sort_by_key()`]: VecDeque::make_contiguous
2521+
/// [`binary_search`]: VecDeque::binary_search
2522+
/// [`binary_search_by`]: VecDeque::binary_search_by
2523+
/// [`partition_point`]: VecDeque::partition_point
2524+
///
25072525
/// # Examples
25082526
///
25092527
/// Looks up a series of four elements in a slice of pairs sorted by
@@ -2549,9 +2567,9 @@ impl<T> VecDeque<T> {
25492567
///
25502568
/// See also [`binary_search`], [`binary_search_by`], and [`binary_search_by_key`].
25512569
///
2552-
/// [`binary_search`]: slice::binary_search
2553-
/// [`binary_search_by`]: slice::binary_search_by
2554-
/// [`binary_search_by_key`]: slice::binary_search_by_key
2570+
/// [`binary_search`]: VecDeque::binary_search
2571+
/// [`binary_search_by`]: VecDeque::binary_search_by
2572+
/// [`binary_search_by_key`]: VecDeque::binary_search_by_key
25552573
///
25562574
/// # Examples
25572575
///

0 commit comments

Comments
 (0)