Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aggregated small commits #7490

Merged
merged 3 commits into from
Jun 30, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/librust/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ fn usage() {

pub fn main() {
let os_args = os::args();

if (os_args.len() > 1 && (os_args[1] == ~"-v" || os_args[1] == ~"--version")) {
rustc::version(os_args[0]);
unsafe { exit(0); }
}

let args = os_args.tail();

if !args.is_empty() {
Expand Down
8 changes: 4 additions & 4 deletions src/libstd/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
}

Expand Down
16 changes: 6 additions & 10 deletions src/libstd/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -40,6 +41,7 @@ use util;

#[cfg(not(test))] use cmp::Equiv;

#[doc(hidden)]
pub mod rustrt {
use libc;
use vec::raw;
Expand Down Expand Up @@ -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))
}
}

Expand Down