Skip to content

Commit

Permalink
Fix slice::binary_search_by_key doc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
circuitfox committed May 4, 2017
1 parent 0cf3324 commit 8016849
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/libcollections/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1116,10 +1116,10 @@ impl<T> [T] {
/// (1, 2), (2, 3), (4, 5), (5, 8), (3, 13),
/// (1, 21), (2, 34), (4, 55)];
///
/// assert_eq!(s.binary_search_by_key(&13, |&(a,b)| b), Ok(9));
/// assert_eq!(s.binary_search_by_key(&4, |&(a,b)| b), Err(7));
/// assert_eq!(s.binary_search_by_key(&100, |&(a,b)| b), Err(13));
/// let r = s.binary_search_by_key(&1, |&(a,b)| b);
/// assert_eq!(s.binary_search_by_key(&13, |&(a, ref b)| b), Ok(9));
/// assert_eq!(s.binary_search_by_key(&4, |&(a, ref b)| b), Err(7));
/// assert_eq!(s.binary_search_by_key(&100, |&(a, ref b)| b), Err(13));
/// let r = s.binary_search_by_key(&1, |&(a, ref b)| b);
/// assert!(match r { Ok(1...4) => true, _ => false, });
/// ```
#[stable(feature = "slice_binary_search_by_key", since = "1.10.0")]
Expand Down

0 comments on commit 8016849

Please sign in to comment.