librustc: Separate most trait bounds with '+'. rs=plussing

This commit is contained in:
Patrick Walton
2013-02-20 17:07:17 -08:00
parent a307608781
commit bf2a225c0b
204 changed files with 729 additions and 726 deletions

View File

@@ -101,7 +101,7 @@ pub pure fn build_sized_opt<A>(size: Option<uint>,
// Appending
#[inline(always)]
pub pure fn append<T: Copy>(lhs: @[T], rhs: &[const T]) -> @[T] {
pub pure fn append<T:Copy>(lhs: @[T], rhs: &[const T]) -> @[T] {
do build_sized(lhs.len() + rhs.len()) |push| {
for vec::each(lhs) |x| { push(*x); }
for uint::range(0, rhs.len()) |i| { push(rhs[i]); }
@@ -137,7 +137,7 @@ pub pure fn from_fn<T>(n_elts: uint, op: iter::InitOp<T>) -> @[T] {
* Creates an immutable vector of size `n_elts` and initializes the elements
* to the value `t`.
*/
pub pure fn from_elem<T: Copy>(n_elts: uint, t: T) -> @[T] {
pub pure fn from_elem<T:Copy>(n_elts: uint, t: T) -> @[T] {
do build_sized(n_elts) |push| {
let mut i: uint = 0u;
while i < n_elts { push(copy t); i += 1u; }
@@ -173,7 +173,7 @@ pub mod traits {
use kinds::Copy;
use ops::Add;
pub impl<T: Copy> Add<&[const T],@[T]> for @[T] {
pub impl<T:Copy> Add<&[const T],@[T]> for @[T] {
#[inline(always)]
pure fn add(&self, rhs: & &self/[const T]) -> @[T] {
append(*self, (*rhs))