libcore: use unboxed closures in SlicePrelude
methods
This commit is contained in:
parent
6ae9b9e54a
commit
e2a362f9bb
1 changed files with 2 additions and 2 deletions
|
@ -238,7 +238,7 @@ pub trait SlicePrelude<T> for Sized? {
|
||||||
/// assert!(match r { Found(1...4) => true, _ => false, });
|
/// assert!(match r { Found(1...4) => true, _ => false, });
|
||||||
/// ```
|
/// ```
|
||||||
#[unstable = "waiting on unboxed closures"]
|
#[unstable = "waiting on unboxed closures"]
|
||||||
fn binary_search(&self, f: |&T| -> Ordering) -> BinarySearchResult;
|
fn binary_search<F>(&self, f: F) -> BinarySearchResult where F: FnMut(&T) -> Ordering;
|
||||||
|
|
||||||
/// Return the number of elements in the slice
|
/// Return the number of elements in the slice
|
||||||
///
|
///
|
||||||
|
@ -552,7 +552,7 @@ impl<T> SlicePrelude<T> for [T] {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[unstable]
|
#[unstable]
|
||||||
fn binary_search(&self, f: |&T| -> Ordering) -> BinarySearchResult {
|
fn binary_search<F>(&self, mut f: F) -> BinarySearchResult where F: FnMut(&T) -> Ordering {
|
||||||
let mut base : uint = 0;
|
let mut base : uint = 0;
|
||||||
let mut lim : uint = self.len();
|
let mut lim : uint = self.len();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue