replace #[inline(always)] with #[inline]. r=burningtree.
This commit is contained in:
@@ -111,7 +111,7 @@ pub fn reserve_at_least<T>(v: &mut ~[T], n: uint) {
|
||||
}
|
||||
|
||||
/// Returns the number of elements the vector can hold without reallocating
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub fn capacity<T>(v: &const ~[T]) -> uint {
|
||||
unsafe {
|
||||
let repr: **raw::VecRepr = transmute(v);
|
||||
@@ -189,7 +189,7 @@ pub fn with_capacity<T>(capacity: uint) -> ~[T] {
|
||||
* as an argument a function that will push an element
|
||||
* onto the vector being constructed.
|
||||
*/
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub fn build_sized<A>(size: uint, builder: &fn(push: &fn(v: A))) -> ~[A] {
|
||||
let mut vec = with_capacity(size);
|
||||
builder(|x| vec.push(x));
|
||||
@@ -206,7 +206,7 @@ pub fn build_sized<A>(size: uint, builder: &fn(push: &fn(v: A))) -> ~[A] {
|
||||
* as an argument a function that will push an element
|
||||
* onto the vector being constructed.
|
||||
*/
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub fn build<A>(builder: &fn(push: &fn(v: A))) -> ~[A] {
|
||||
build_sized(4, builder)
|
||||
}
|
||||
@@ -223,7 +223,7 @@ pub fn build<A>(builder: &fn(push: &fn(v: A))) -> ~[A] {
|
||||
* as an argument a function that will push an element
|
||||
* onto the vector being constructed.
|
||||
*/
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub fn build_sized_opt<A>(size: Option<uint>,
|
||||
builder: &fn(push: &fn(v: A)))
|
||||
-> ~[A] {
|
||||
@@ -271,7 +271,7 @@ pub fn last_opt<'r,T>(v: &'r [T]) -> Option<&'r T> {
|
||||
}
|
||||
|
||||
/// Return a slice that points into another slice.
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub fn slice<'r,T>(v: &'r [T], start: uint, end: uint) -> &'r [T] {
|
||||
assert!(start <= end);
|
||||
assert!(end <= v.len());
|
||||
@@ -284,7 +284,7 @@ pub fn slice<'r,T>(v: &'r [T], start: uint, end: uint) -> &'r [T] {
|
||||
}
|
||||
|
||||
/// Return a slice that points into another slice.
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub fn mut_slice<'r,T>(v: &'r mut [T], start: uint, end: uint)
|
||||
-> &'r mut [T] {
|
||||
assert!(start <= end);
|
||||
@@ -298,7 +298,7 @@ pub fn mut_slice<'r,T>(v: &'r mut [T], start: uint, end: uint)
|
||||
}
|
||||
|
||||
/// Return a slice that points into another slice.
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub fn const_slice<'r,T>(v: &'r const [T], start: uint, end: uint)
|
||||
-> &'r const [T] {
|
||||
assert!(start <= end);
|
||||
@@ -633,7 +633,7 @@ pub fn swap_remove<T>(v: &mut ~[T], index: uint) -> T {
|
||||
}
|
||||
|
||||
/// Append an element to a vector
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub fn push<T>(v: &mut ~[T], initval: T) {
|
||||
unsafe {
|
||||
let repr: **raw::VecRepr = transmute(&mut *v);
|
||||
@@ -648,7 +648,7 @@ pub fn push<T>(v: &mut ~[T], initval: T) {
|
||||
}
|
||||
|
||||
// This doesn't bother to make sure we have space.
|
||||
#[inline(always)] // really pretty please
|
||||
#[inline] // really pretty please
|
||||
unsafe fn push_fast<T>(v: &mut ~[T], initval: T) {
|
||||
let repr: **mut raw::VecRepr = transmute(v);
|
||||
let fill = (**repr).unboxed.fill;
|
||||
@@ -675,7 +675,7 @@ fn push_slow<T>(v: &mut ~[T], initval: T) {
|
||||
/// vec::push_all(&mut a, [2, 3, 4]);
|
||||
/// assert!(a == ~[1, 2, 3, 4]);
|
||||
/// ~~~
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub fn push_all<T:Copy>(v: &mut ~[T], rhs: &const [T]) {
|
||||
let new_len = v.len() + rhs.len();
|
||||
reserve(&mut *v, new_len);
|
||||
@@ -696,7 +696,7 @@ pub fn push_all<T:Copy>(v: &mut ~[T], rhs: &const [T]) {
|
||||
/// vec::push_all_move(&mut a, ~[~2, ~3, ~4]);
|
||||
/// assert!(a == ~[~1, ~2, ~3, ~4]);
|
||||
/// ~~~
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub fn push_all_move<T>(v: &mut ~[T], mut rhs: ~[T]) {
|
||||
let new_len = v.len() + rhs.len();
|
||||
reserve(&mut *v, new_len);
|
||||
@@ -767,7 +767,7 @@ pub fn dedup<T:Eq>(v: &mut ~[T]) {
|
||||
|
||||
/// Iterates over the `rhs` vector, copying each element and appending it to the
|
||||
/// `lhs`. Afterwards, the `lhs` is then returned for use again.
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub fn append<T:Copy>(lhs: ~[T], rhs: &const [T]) -> ~[T] {
|
||||
let mut v = lhs;
|
||||
v.push_all(rhs);
|
||||
@@ -776,7 +776,7 @@ pub fn append<T:Copy>(lhs: ~[T], rhs: &const [T]) -> ~[T] {
|
||||
|
||||
/// Appends one element to the vector provided. The vector itself is then
|
||||
/// returned for use again.
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub fn append_one<T>(lhs: ~[T], x: T) -> ~[T] {
|
||||
let mut v = lhs;
|
||||
v.push(x);
|
||||
@@ -1295,7 +1295,7 @@ pub fn zip<T, U>(mut v: ~[T], mut u: ~[U]) -> ~[(T, U)] {
|
||||
* * a - The index of the first element
|
||||
* * b - The index of the second element
|
||||
*/
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub fn swap<T>(v: &mut [T], a: uint, b: uint) {
|
||||
unsafe {
|
||||
// Can't take two mutable loans from one vector, so instead just cast
|
||||
@@ -1403,7 +1403,7 @@ pub fn reversed<T:Copy>(v: &const [T]) -> ~[T] {
|
||||
* }
|
||||
* ~~~
|
||||
*/
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub fn each<'r,T>(v: &'r [T], f: &fn(&'r T) -> bool) -> bool {
|
||||
// ^^^^
|
||||
// NB---this CANNOT be &const [T]! The reason
|
||||
@@ -1429,7 +1429,7 @@ pub fn each<'r,T>(v: &'r [T], f: &fn(&'r T) -> bool) -> bool {
|
||||
|
||||
/// Like `each()`, but for the case where you have a vector that *may or may
|
||||
/// not* have mutable contents.
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub fn each_const<T>(v: &const [T], f: &fn(elem: &const T) -> bool) -> bool {
|
||||
let mut i = 0;
|
||||
let n = v.len();
|
||||
@@ -1447,7 +1447,7 @@ pub fn each_const<T>(v: &const [T], f: &fn(elem: &const T) -> bool) -> bool {
|
||||
*
|
||||
* Return true to continue, false to break.
|
||||
*/
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub fn eachi<'r,T>(v: &'r [T], f: &fn(uint, v: &'r T) -> bool) -> bool {
|
||||
let mut i = 0;
|
||||
for each(v) |p| {
|
||||
@@ -1540,7 +1540,7 @@ pub fn windowed<'r, T>(n: uint, v: &'r [T], it: &fn(&'r [T]) -> bool) -> bool {
|
||||
* Allows for unsafe manipulation of vector contents, which is useful for
|
||||
* foreign interop.
|
||||
*/
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub fn as_imm_buf<T,U>(s: &[T],
|
||||
/* NB---this CANNOT be const, see below */
|
||||
f: &fn(*T, uint) -> U) -> U {
|
||||
@@ -1559,7 +1559,7 @@ pub fn as_imm_buf<T,U>(s: &[T],
|
||||
}
|
||||
|
||||
/// Similar to `as_imm_buf` but passing a `*const T`
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub fn as_const_buf<T,U>(s: &const [T], f: &fn(*const T, uint) -> U) -> U {
|
||||
unsafe {
|
||||
let v : *(*const T,uint) = transmute(&s);
|
||||
@@ -1569,7 +1569,7 @@ pub fn as_const_buf<T,U>(s: &const [T], f: &fn(*const T, uint) -> U) -> U {
|
||||
}
|
||||
|
||||
/// Similar to `as_imm_buf` but passing a `*mut T`
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub fn as_mut_buf<T,U>(s: &mut [T], f: &fn(*mut T, uint) -> U) -> U {
|
||||
unsafe {
|
||||
let v : *(*mut T,uint) = transmute(&s);
|
||||
@@ -1612,49 +1612,49 @@ fn equals<T: TotalEq>(a: &[T], b: &[T]) -> bool {
|
||||
|
||||
#[cfg(not(test))]
|
||||
impl<'self,T:Eq> Eq for &'self [T] {
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn eq(&self, other: & &'self [T]) -> bool { eq(*self, *other) }
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn ne(&self, other: & &'self [T]) -> bool { !self.eq(other) }
|
||||
}
|
||||
|
||||
#[cfg(not(test))]
|
||||
impl<T:Eq> Eq for ~[T] {
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn eq(&self, other: &~[T]) -> bool { eq(*self, *other) }
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn ne(&self, other: &~[T]) -> bool { !self.eq(other) }
|
||||
}
|
||||
|
||||
#[cfg(not(test))]
|
||||
impl<T:Eq> Eq for @[T] {
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn eq(&self, other: &@[T]) -> bool { eq(*self, *other) }
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn ne(&self, other: &@[T]) -> bool { !self.eq(other) }
|
||||
}
|
||||
|
||||
#[cfg(not(test))]
|
||||
impl<'self,T:TotalEq> TotalEq for &'self [T] {
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn equals(&self, other: & &'self [T]) -> bool { equals(*self, *other) }
|
||||
}
|
||||
|
||||
#[cfg(not(test))]
|
||||
impl<T:TotalEq> TotalEq for ~[T] {
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn equals(&self, other: &~[T]) -> bool { equals(*self, *other) }
|
||||
}
|
||||
|
||||
#[cfg(not(test))]
|
||||
impl<T:TotalEq> TotalEq for @[T] {
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn equals(&self, other: &@[T]) -> bool { equals(*self, *other) }
|
||||
}
|
||||
|
||||
#[cfg(not(test))]
|
||||
impl<'self,T:Eq> Equiv<~[T]> for &'self [T] {
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn equiv(&self, other: &~[T]) -> bool { eq(*self, *other) }
|
||||
}
|
||||
|
||||
@@ -1676,19 +1676,19 @@ fn cmp<T: TotalOrd>(a: &[T], b: &[T]) -> Ordering {
|
||||
|
||||
#[cfg(not(test))]
|
||||
impl<'self,T:TotalOrd> TotalOrd for &'self [T] {
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn cmp(&self, other: & &'self [T]) -> Ordering { cmp(*self, *other) }
|
||||
}
|
||||
|
||||
#[cfg(not(test))]
|
||||
impl<T: TotalOrd> TotalOrd for ~[T] {
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn cmp(&self, other: &~[T]) -> Ordering { cmp(*self, *other) }
|
||||
}
|
||||
|
||||
#[cfg(not(test))]
|
||||
impl<T: TotalOrd> TotalOrd for @[T] {
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn cmp(&self, other: &@[T]) -> Ordering { cmp(*self, *other) }
|
||||
}
|
||||
|
||||
@@ -1713,37 +1713,37 @@ fn gt<T:Ord>(a: &[T], b: &[T]) -> bool { lt(b, a) }
|
||||
|
||||
#[cfg(not(test))]
|
||||
impl<'self,T:Ord> Ord for &'self [T] {
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn lt(&self, other: & &'self [T]) -> bool { lt((*self), (*other)) }
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn le(&self, other: & &'self [T]) -> bool { le((*self), (*other)) }
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn ge(&self, other: & &'self [T]) -> bool { ge((*self), (*other)) }
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn gt(&self, other: & &'self [T]) -> bool { gt((*self), (*other)) }
|
||||
}
|
||||
|
||||
#[cfg(not(test))]
|
||||
impl<T:Ord> Ord for ~[T] {
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn lt(&self, other: &~[T]) -> bool { lt((*self), (*other)) }
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn le(&self, other: &~[T]) -> bool { le((*self), (*other)) }
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn ge(&self, other: &~[T]) -> bool { ge((*self), (*other)) }
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn gt(&self, other: &~[T]) -> bool { gt((*self), (*other)) }
|
||||
}
|
||||
|
||||
#[cfg(not(test))]
|
||||
impl<T:Ord> Ord for @[T] {
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn lt(&self, other: &@[T]) -> bool { lt((*self), (*other)) }
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn le(&self, other: &@[T]) -> bool { le((*self), (*other)) }
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn ge(&self, other: &@[T]) -> bool { ge((*self), (*other)) }
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn gt(&self, other: &@[T]) -> bool { gt((*self), (*other)) }
|
||||
}
|
||||
|
||||
@@ -1754,7 +1754,7 @@ pub mod traits {
|
||||
use vec::append;
|
||||
|
||||
impl<'self,T:Copy> Add<&'self const [T],~[T]> for ~[T] {
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn add(&self, rhs: & &'self const [T]) -> ~[T] {
|
||||
append(copy *self, (*rhs))
|
||||
}
|
||||
@@ -1958,7 +1958,7 @@ impl<'self,T> ImmutableVector<'self, T> for &'self [T] {
|
||||
|
||||
/// Returns a pointer to the element at the given index, without doing
|
||||
/// bounds checking.
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
unsafe fn unsafe_ref(&self, index: uint) -> *T {
|
||||
let (ptr, _): (*T, uint) = transmute(*self);
|
||||
ptr.offset(index)
|
||||
@@ -2029,7 +2029,7 @@ impl<'self,T:Copy> ImmutableCopyableVector<T> for &'self [T] {
|
||||
}
|
||||
|
||||
/// Returns the element at the given index, without doing bounds checking.
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
unsafe fn unsafe_get(&self, index: uint) -> T {
|
||||
copy *self.unsafe_ref(index)
|
||||
}
|
||||
@@ -2210,14 +2210,14 @@ impl<'self,T> MutableVector<'self, T> for &'self mut [T] {
|
||||
}
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
unsafe fn unsafe_mut_ref(&self, index: uint) -> *mut T {
|
||||
let pair_ptr: &(*mut T, uint) = transmute(self);
|
||||
let (ptr, _) = *pair_ptr;
|
||||
ptr.offset(index)
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
unsafe fn unsafe_set(&self, index: uint, val: T) {
|
||||
*self.unsafe_mut_ref(index) = val;
|
||||
}
|
||||
@@ -2278,7 +2278,7 @@ pub mod raw {
|
||||
* modifing its buffers, so it is up to the caller to ensure that
|
||||
* the vector is actually the specified size.
|
||||
*/
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub unsafe fn set_len<T>(v: &mut ~[T], new_len: uint) {
|
||||
let repr: **mut VecRepr = transmute(v);
|
||||
(**repr).unboxed.fill = new_len * sys::nonzero_size_of::<T>();
|
||||
@@ -2293,7 +2293,7 @@ pub mod raw {
|
||||
* Modifying the vector may cause its buffer to be reallocated, which
|
||||
* would also make any pointers to it invalid.
|
||||
*/
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub fn to_ptr<T>(v: &[T]) -> *T {
|
||||
unsafe {
|
||||
let repr: **SliceRepr = transmute(&v);
|
||||
@@ -2302,7 +2302,7 @@ pub mod raw {
|
||||
}
|
||||
|
||||
/** see `to_ptr()` */
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub fn to_const_ptr<T>(v: &const [T]) -> *const T {
|
||||
unsafe {
|
||||
let repr: **SliceRepr = transmute(&v);
|
||||
@@ -2311,7 +2311,7 @@ pub mod raw {
|
||||
}
|
||||
|
||||
/** see `to_ptr()` */
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub fn to_mut_ptr<T>(v: &mut [T]) -> *mut T {
|
||||
unsafe {
|
||||
let repr: **SliceRepr = transmute(&v);
|
||||
@@ -2323,7 +2323,7 @@ pub mod raw {
|
||||
* Form a slice from a pointer and length (as a number of units,
|
||||
* not bytes).
|
||||
*/
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub unsafe fn buf_as_slice<T,U>(p: *T,
|
||||
len: uint,
|
||||
f: &fn(v: &[T]) -> U) -> U {
|
||||
@@ -2336,7 +2336,7 @@ pub mod raw {
|
||||
* Form a slice from a pointer and length (as a number of units,
|
||||
* not bytes).
|
||||
*/
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub unsafe fn mut_buf_as_slice<T,U>(p: *mut T,
|
||||
len: uint,
|
||||
f: &fn(v: &mut [T]) -> U) -> U {
|
||||
@@ -2348,7 +2348,7 @@ pub mod raw {
|
||||
/**
|
||||
* Unchecked vector indexing.
|
||||
*/
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub unsafe fn get<T:Copy>(v: &const [T], i: uint) -> T {
|
||||
as_const_buf(v, |p, _len| copy *ptr::const_offset(p, i))
|
||||
}
|
||||
@@ -2358,7 +2358,7 @@ pub mod raw {
|
||||
* old value and hence is only suitable when the vector
|
||||
* is newly allocated.
|
||||
*/
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub unsafe fn init_elem<T>(v: &mut [T], i: uint, val: T) {
|
||||
let mut box = Some(val);
|
||||
do as_mut_buf(v) |p, _len| {
|
||||
@@ -2377,7 +2377,7 @@ pub mod raw {
|
||||
* * elts - The number of elements in the buffer
|
||||
*/
|
||||
// Was in raw, but needs to be called by net_tcp::on_tcp_read_cb
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub unsafe fn from_buf_raw<T>(ptr: *T, elts: uint) -> ~[T] {
|
||||
let mut dst = with_capacity(elts);
|
||||
set_len(&mut dst, elts);
|
||||
@@ -2391,7 +2391,7 @@ pub mod raw {
|
||||
* Copies `count` bytes from `src` to `dst`. The source and destination
|
||||
* may overlap.
|
||||
*/
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub unsafe fn copy_memory<T>(dst: &mut [T], src: &const [T],
|
||||
count: uint) {
|
||||
assert!(dst.len() >= count);
|
||||
@@ -2457,7 +2457,7 @@ pub mod bytes {
|
||||
* Copies `count` bytes from `src` to `dst`. The source and destination
|
||||
* may overlap.
|
||||
*/
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub fn copy_memory(dst: &mut [u8], src: &const [u8], count: uint) {
|
||||
// Bound checks are done at vec::raw::copy_memory.
|
||||
unsafe { vec::raw::copy_memory(dst, src, count) }
|
||||
@@ -2468,31 +2468,31 @@ pub mod bytes {
|
||||
// ITERATION TRAIT METHODS
|
||||
|
||||
impl<'self,A> old_iter::BaseIter<A> for &'self [A] {
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn each<'a>(&'a self, blk: &fn(v: &'a A) -> bool) -> bool {
|
||||
each(*self, blk)
|
||||
}
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn size_hint(&self) -> Option<uint> { Some(self.len()) }
|
||||
}
|
||||
|
||||
// FIXME(#4148): This should be redundant
|
||||
impl<A> old_iter::BaseIter<A> for ~[A] {
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn each<'a>(&'a self, blk: &fn(v: &'a A) -> bool) -> bool {
|
||||
each(*self, blk)
|
||||
}
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn size_hint(&self) -> Option<uint> { Some(self.len()) }
|
||||
}
|
||||
|
||||
// FIXME(#4148): This should be redundant
|
||||
impl<A> old_iter::BaseIter<A> for @[A] {
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn each<'a>(&'a self, blk: &fn(v: &'a A) -> bool) -> bool {
|
||||
each(*self, blk)
|
||||
}
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
fn size_hint(&self) -> Option<uint> { Some(self.len()) }
|
||||
}
|
||||
|
||||
@@ -2710,7 +2710,7 @@ pub struct VecMutRevIterator<'self, T> {
|
||||
iterator!{impl VecMutRevIterator -> &'self mut T, -1}
|
||||
|
||||
impl<T> FromIter<T> for ~[T]{
|
||||
#[inline(always)]
|
||||
#[inline]
|
||||
pub fn from_iter(iter: &fn(f: &fn(T) -> bool) -> bool) -> ~[T] {
|
||||
let mut v = ~[];
|
||||
for iter |x| { v.push(x) }
|
||||
|
||||
Reference in New Issue
Block a user