mirror of
https://github.com/rust-lang/cargo
synced 2024-10-01 21:43:45 +00:00
auto merge of #107 : alexcrichton/cargo/issue-102, r=wycats
Closes #102
This commit is contained in:
commit
e00e924e53
|
@ -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)
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue