34
34
// * The `raw` and `bytes` submodules.
35
35
// * Boilerplate trait implementations.
36
36
37
- pub use self :: BinarySearchResult :: * ;
38
-
39
37
use mem:: transmute;
40
38
use clone:: Clone ;
41
39
use cmp:: { PartialEq , PartialOrd , Eq , Ord , Ordering , Less , Equal , Greater , Equiv } ;
@@ -219,7 +217,7 @@ pub trait SlicePrelude<T> for Sized? {
219
217
/// found; the fourth could match any position in `[1,4]`.
220
218
///
221
219
/// ```rust
222
- /// use std::slice::{Found, NotFound};
220
+ /// use std::slice::BinarySearchResult:: {Found, NotFound};
223
221
/// let s = [0i, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
224
222
/// let s = s.as_slice();
225
223
///
@@ -548,7 +546,7 @@ impl<T> SlicePrelude<T> for [T] {
548
546
while lim != 0 {
549
547
let ix = base + ( lim >> 1 ) ;
550
548
match f ( & self [ ix] ) {
551
- Equal => return Found ( ix) ,
549
+ Equal => return BinarySearchResult :: Found ( ix) ,
552
550
Less => {
553
551
base = ix + 1 ;
554
552
lim -= 1 ;
@@ -557,7 +555,7 @@ impl<T> SlicePrelude<T> for [T] {
557
555
}
558
556
lim >>= 1 ;
559
557
}
560
- return NotFound ( base) ;
558
+ return BinarySearchResult :: NotFound ( base) ;
561
559
}
562
560
563
561
#[ inline]
@@ -838,7 +836,7 @@ pub trait OrdSlicePrelude<T: Ord> for Sized? {
838
836
/// found; the fourth could match any position in `[1,4]`.
839
837
///
840
838
/// ```rust
841
- /// use std::slice::{Found, NotFound};
839
+ /// use std::slice::BinarySearchResult:: {Found, NotFound};
842
840
/// let s = [0i, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
843
841
/// let s = s.as_slice();
844
842
///
@@ -1517,17 +1515,17 @@ impl BinarySearchResult {
1517
1515
/// Similar to `Result::ok`.
1518
1516
pub fn found ( & self ) -> Option < uint > {
1519
1517
match * self {
1520
- Found ( i) => Some ( i) ,
1521
- NotFound ( _) => None
1518
+ BinarySearchResult :: Found ( i) => Some ( i) ,
1519
+ BinarySearchResult :: NotFound ( _) => None
1522
1520
}
1523
1521
}
1524
1522
1525
1523
/// Convert a `Found` to `None`, `NotFound` to `Some`.
1526
1524
/// Similar to `Result::err`.
1527
1525
pub fn not_found ( & self ) -> Option < uint > {
1528
1526
match * self {
1529
- Found ( _) => None ,
1530
- NotFound ( i) => Some ( i)
1527
+ BinarySearchResult :: Found ( _) => None ,
1528
+ BinarySearchResult :: NotFound ( i) => Some ( i)
1531
1529
}
1532
1530
}
1533
1531
}
0 commit comments