From 8016849bb4ba4b7321d48dadcd57c6958d3bb8d5 Mon Sep 17 00:00:00 2001 From: Chris Stankus Date: Thu, 4 May 2017 10:56:37 -0500 Subject: [PATCH] Fix slice::binary_search_by_key doc tests --- src/libcollections/slice.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs index 44dc9f80503a8..1e1ecaf843f9a 100644 --- a/src/libcollections/slice.rs +++ b/src/libcollections/slice.rs @@ -1116,10 +1116,10 @@ impl [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")]