Skip to content

Commit e2a362f

Browse files
author
Jorge Aparicio
committed
libcore: use unboxed closures in SlicePrelude methods
1 parent 6ae9b9e commit e2a362f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcore/slice.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ pub trait SlicePrelude<T> for Sized? {
238238
/// assert!(match r { Found(1...4) => true, _ => false, });
239239
/// ```
240240
#[unstable = "waiting on unboxed closures"]
241-
fn binary_search(&self, f: |&T| -> Ordering) -> BinarySearchResult;
241+
fn binary_search<F>(&self, f: F) -> BinarySearchResult where F: FnMut(&T) -> Ordering;
242242

243243
/// Return the number of elements in the slice
244244
///
@@ -552,7 +552,7 @@ impl<T> SlicePrelude<T> for [T] {
552552
}
553553

554554
#[unstable]
555-
fn binary_search(&self, f: |&T| -> Ordering) -> BinarySearchResult {
555+
fn binary_search<F>(&self, mut f: F) -> BinarySearchResult where F: FnMut(&T) -> Ordering {
556556
let mut base : uint = 0;
557557
let mut lim : uint = self.len();
558558

0 commit comments

Comments
 (0)