diff options
| author | Graydon Hoare <graydon@mozilla.com> | 2012-08-30 11:10:01 -0700 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2012-08-30 12:38:28 -0700 |
| commit | a9619306a512ded537a84a45c7717f32f468d31b (patch) | |
| tree | 55b5484d0ac9166b5b70988b92a7bdd3bf0f4d4c /src/libcore/vec.rs | |
| parent | ab53819a2cbbfbc2df7a3aea4e9a0b52dfb830dc (diff) | |
Start moving core::hash to support a Hash trait. Add to_bytes::IterBytes trait.
Diffstat (limited to 'src/libcore/vec.rs')
| -rw-r--r-- | src/libcore/vec.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libcore/vec.rs b/src/libcore/vec.rs index baf6c7c8601..1533b07861c 100644 --- a/src/libcore/vec.rs +++ b/src/libcore/vec.rs @@ -1168,7 +1168,7 @@ pure fn iter_between<T>(v: &[T], start: uint, end: uint, f: fn(T)) { * Return true to continue, false to break. */ #[inline(always)] -pure fn each<T>(v: &[T], f: fn(T) -> bool) { +pure fn each<T>(v: &[const T], f: fn(T) -> bool) { do vec::as_buf(v) |p, n| { let mut n = n; let mut p = p; @@ -1206,7 +1206,7 @@ pure fn each_mut<T>(v: &[mut T], f: fn(elem: &mut T) -> bool) { * Return true to continue, false to break. */ #[inline(always)] -pure fn eachi<T>(v: &[T], f: fn(uint, T) -> bool) { +pure fn eachi<T>(v: &[const T], f: fn(uint, T) -> bool) { do vec::as_buf(v) |p, n| { let mut i = 0u; let mut p = p; @@ -1916,12 +1916,12 @@ mod u8 { // This cannot be used with iter-trait.rs because of the region pointer // required in the slice. -impl<A> &[A]: iter::BaseIter<A> { +impl<A> &[const A]: iter::BaseIter<A> { pure fn each(blk: fn(A) -> bool) { each(self, blk) } pure fn size_hint() -> Option<uint> { Some(len(self)) } } -impl<A> &[A]: iter::ExtendedIter<A> { +impl<A> &[const A]: iter::ExtendedIter<A> { pure fn eachi(blk: fn(uint, A) -> bool) { iter::eachi(self, blk) } pure fn all(blk: fn(A) -> bool) -> bool { iter::all(self, blk) } pure fn any(blk: fn(A) -> bool) -> bool { iter::any(self, blk) } |
