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
///
@@ -1613,17 +1611,17 @@ impl BinarySearchResult {
1613
1611
/// Similar to `Result::ok`.
1614
1612
pub fn found ( & self ) -> Option < uint > {
1615
1613
match * self {
1616
- Found ( i) => Some ( i) ,
1617
- NotFound ( _) => None
1614
+ BinarySearchResult :: Found ( i) => Some ( i) ,
1615
+ BinarySearchResult :: NotFound ( _) => None
1618
1616
}
1619
1617
}
1620
1618
1621
1619
/// Convert a `Found` to `None`, `NotFound` to `Some`.
1622
1620
/// Similar to `Result::err`.
1623
1621
pub fn not_found ( & self ) -> Option < uint > {
1624
1622
match * self {
1625
- Found ( _) => None ,
1626
- NotFound ( i) => Some ( i)
1623
+ BinarySearchResult :: Found ( _) => None ,
1624
+ BinarySearchResult :: NotFound ( i) => Some ( i)
1627
1625
}
1628
1626
}
1629
1627
}
0 commit comments