auto merge of #107 : alexcrichton/cargo/issue-102, r=wycats

Closes #102
This commit is contained in:
bors 2014-07-01 22:49:29 +00:00
commit e00e924e53
4 changed files with 8 additions and 9 deletions

View file

@ -15,7 +15,7 @@ use cargo::ops;
use cargo::{execute_main_without_stdin};
use cargo::core::{MultiShell};
use cargo::util;
use cargo::util::{CliResult, CliError};
use cargo::util::{CliResult, CliError, CargoError};
use cargo::util::important_paths::find_project_manifest;
#[deriving(PartialEq,Clone,Decodable)]
@ -56,7 +56,9 @@ fn execute(options: Options, shell: &mut MultiShell) -> CliResult<Option<()>> {
}));
for file in walk {
try!(util::process(file).exec().map_err(|e| CliError::from_boxed(e.box_error(), 1)));
try!(util::process(file).exec().map_err(|e| {
CliError::from_boxed(e.box_error(), 1)
}));
}
Ok(None)

View file

@ -120,10 +120,7 @@ impl<D: Decoder<Box<CargoError + Send>>>
for PackageId
{
fn decode(d: &mut D) -> Result<PackageId, Box<CargoError + Send>> {
let vector: Vec<String> = match Decodable::decode(d) {
Ok(v) => v,
Err(e) => return Err(e.to_error())
};
let vector: Vec<String> = try!(Decodable::decode(d));
PackageId::new(
vector.get(0).as_slice(),

View file

@ -50,8 +50,8 @@ mod cargo {
#[macro_export]
macro_rules! try (
($expr:expr) => ({
use cargo::util::CargoError;
match $expr.map_err(|err| err.to_error()) {
use cargo::util::FromError;
match $expr.map_err(FromError::from_error) {
Ok(val) => val,
Err(err) => return Err(err)
}

View file

@ -3,7 +3,7 @@ use std::collections::HashMap;
use serialize::{Encodable,Encoder};
use toml;
use core::MultiShell;
use util::{CargoResult, CargoError, ChainError, Require, internal, human};
use util::{CargoResult, ChainError, Require, internal, human};
use cargo_toml = util::toml;