diff options
| author | bors <bors@rust-lang.org> | 2013-06-29 23:34:43 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-06-29 23:34:43 -0700 |
| commit | b4bb36490d10a9d2613448215f2436f258e7fd28 (patch) | |
| tree | 1ed09680bb201daccfed14b773dea8eb9d00deca /src/libstd | |
| parent | c6b0d4f51610401355a27eb2c5f607e913b74be9 (diff) | |
| parent | 052f28a8083c624a8f0a892893f9a059906e15c5 (diff) | |
| download | rust-b4bb36490d10a9d2613448215f2436f258e7fd28.tar.gz rust-b4bb36490d10a9d2613448215f2436f258e7fd28.zip | |
auto merge of #7490 : mozilla/rust/rollup, r=thestinger
603137c r=cmr fe10db2 r=bstrie
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/iterator.rs | 8 | ||||
| -rw-r--r-- | src/libstd/vec.rs | 16 |
2 files changed, 10 insertions, 14 deletions
diff --git a/src/libstd/iterator.rs b/src/libstd/iterator.rs index 976ca8bae7a..55eae8f8fae 100644 --- a/src/libstd/iterator.rs +++ b/src/libstd/iterator.rs @@ -356,20 +356,20 @@ pub trait IteratorUtil<A> { /// /// # Example /// - /// --- {.rust} + /// ~~~ {.rust} /// let xs = [-3, 0, 1, 5, -10]; /// assert_eq!(*xs.iter().max_by(|x| x.abs()).unwrap(), -10); - /// --- + /// ~~~ fn max_by<B: Ord>(&mut self, f: &fn(&A) -> B) -> Option<A>; /// Return the element that gives the minimum value from the specfied function /// /// # Example /// - /// --- {.rust} + /// ~~~ {.rust} /// let xs = [-3, 0, 1, 5, -10]; /// assert_eq!(*xs.iter().min_by(|x| x.abs()).unwrap(), 0); - /// --- + /// ~~~ fn min_by<B: Ord>(&mut self, f: &fn(&A) -> B) -> Option<A>; } diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs index 4196fbac0be..cff4ac10145 100644 --- a/src/libstd/vec.rs +++ b/src/libstd/vec.rs @@ -23,6 +23,7 @@ use iter::FromIter; use kinds::Copy; use libc; use num::Zero; +use ops::Add; use option::{None, Option, Some}; use ptr::to_unsafe_ptr; use ptr; @@ -40,6 +41,7 @@ use util; #[cfg(not(test))] use cmp::Equiv; +#[doc(hidden)] pub mod rustrt { use libc; use vec::raw; @@ -1180,16 +1182,10 @@ impl<T:Ord> Ord for @[T] { } #[cfg(not(test))] -pub mod traits { - use kinds::Copy; - use ops::Add; - use vec::append; - - impl<'self,T:Copy> Add<&'self [T],~[T]> for ~[T] { - #[inline] - fn add(&self, rhs: & &'self [T]) -> ~[T] { - 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)) } } |
