diff options
| author | Jorge Aparicio <japaricious@gmail.com> | 2014-12-05 02:04:33 -0500 |
|---|---|---|
| committer | Jorge Aparicio <japaricious@gmail.com> | 2014-12-13 17:03:45 -0500 |
| commit | e2a362f9bbf94eedca42eceea2929e4d96f4eeee (patch) | |
| tree | 63d85c8991e68248c4770818698723363d7dcf87 /src | |
| parent | 6ae9b9e54a9eb9711b32d663bb1a044f7540b4b0 (diff) | |
| download | rust-e2a362f9bbf94eedca42eceea2929e4d96f4eeee.tar.gz rust-e2a362f9bbf94eedca42eceea2929e4d96f4eeee.zip | |
libcore: use unboxed closures in `SlicePrelude` methods
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcore/slice.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs index cfdb406f711..af150994765 100644 --- a/src/libcore/slice.rs +++ b/src/libcore/slice.rs @@ -238,7 +238,7 @@ pub trait SlicePrelude<T> for Sized? { /// assert!(match r { Found(1...4) => true, _ => false, }); /// ``` #[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 /// @@ -552,7 +552,7 @@ impl<T> SlicePrelude<T> for [T] { } #[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 lim : uint = self.len(); |
