minor vec cleanup
* hide the rustrt module in the docs * remove the useless `traits` module wrapping the `Add` impl
This commit is contained in:
@@ -23,6 +23,7 @@ use iter::FromIter;
|
|||||||
use kinds::Copy;
|
use kinds::Copy;
|
||||||
use libc;
|
use libc;
|
||||||
use num::Zero;
|
use num::Zero;
|
||||||
|
use ops::Add;
|
||||||
use option::{None, Option, Some};
|
use option::{None, Option, Some};
|
||||||
use ptr::to_unsafe_ptr;
|
use ptr::to_unsafe_ptr;
|
||||||
use ptr;
|
use ptr;
|
||||||
@@ -40,6 +41,7 @@ use util;
|
|||||||
|
|
||||||
#[cfg(not(test))] use cmp::Equiv;
|
#[cfg(not(test))] use cmp::Equiv;
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
pub mod rustrt {
|
pub mod rustrt {
|
||||||
use libc;
|
use libc;
|
||||||
use vec::raw;
|
use vec::raw;
|
||||||
@@ -1180,16 +1182,10 @@ impl<T:Ord> Ord for @[T] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(test))]
|
#[cfg(not(test))]
|
||||||
pub mod traits {
|
impl<'self,T:Copy> Add<&'self [T], ~[T]> for ~[T] {
|
||||||
use kinds::Copy;
|
#[inline]
|
||||||
use ops::Add;
|
fn add(&self, rhs: & &'self [T]) -> ~[T] {
|
||||||
use vec::append;
|
append(copy *self, (*rhs))
|
||||||
|
|
||||||
impl<'self,T:Copy> Add<&'self [T],~[T]> for ~[T] {
|
|
||||||
#[inline]
|
|
||||||
fn add(&self, rhs: & &'self [T]) -> ~[T] {
|
|
||||||
append(copy *self, (*rhs))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user