Update to master and fix warnings

This commit is contained in:
Yehuda Katz + Carl Lerche 2014-06-12 13:45:10 -07:00 committed by Tim Carey-Smith
parent d6f9072728
commit 9c101e39a4
10 changed files with 13 additions and 16 deletions

@ -1 +1 @@
Subproject commit ae740b4ba884050eeae5b39048de0c31c6bdef30
Subproject commit aeaa9b7a216b42c42988521e79981f523e7a63fe

View File

@ -33,7 +33,7 @@ fn execute(options: Options) -> CLIResult<Option<()>> {
CLIError::new(format!("The URL `{}` you passed was not a valid URL", url), None::<&str>, 1)));
let remote = GitRemote::new(url, verbose);
let source = GitSource::new(remote, reference, Path::new(database_path), Path::new(checkout_path), verbose);
let source = GitSource::new(remote, reference, Path::new(database_path), Path::new(checkout_path));
try!(source.update().map_err(|e| {
CLIError::new(format!("Couldn't update {}: {}", source, e), None::<&str>, 1)
}));

View File

@ -6,7 +6,6 @@ use core::source::SourceId;
use core::{
Dependency,
PackageId,
Source,
Summary
};
use core::dependency::SerializedDependency;

View File

@ -1,7 +1,6 @@
use url::Url;
use core::{Summary,Package,PackageId};
use util::CargoResult;
use sources::GitSource;
/**
* A Source finds and downloads remote packages based on names and

View File

@ -64,7 +64,7 @@ fn sources_for(package: &Package) -> CargoResult<SourceSet> {
// .cargo/git/checkouts
let db_path = git.join("db").join(source_id.url.to_str());
let checkout_path = git.join("checkouts").join(source_id.url.to_str()).join(reference.as_slice());
Ok(box GitSource::new(remote, reference.clone(), db_path, checkout_path, false) as Box<Source>)
Ok(box GitSource::new(remote, reference.clone(), db_path, checkout_path) as Box<Source>)
}
}
})));

View File

@ -11,13 +11,12 @@ pub struct GitSource {
remote: GitRemote,
reference: GitReference,
db_path: Path,
checkout_path: Path,
verbose: bool
checkout_path: Path
}
impl GitSource {
pub fn new(remote: GitRemote, reference: String, db: Path, checkout: Path, verbose: bool) -> GitSource {
GitSource { remote: remote, reference: GitReference::for_str(reference), db_path: db, checkout_path: checkout, verbose: verbose }
pub fn new(remote: GitRemote, reference: String, db: Path, checkout: Path) -> GitSource {
GitSource { remote: remote, reference: GitReference::for_str(reference), db_path: db, checkout_path: checkout }
}
pub fn get_namespace<'a>(&'a self) -> &'a url::Url {

View File

@ -2,7 +2,7 @@ use std::hash::Hash;
use std::collections::HashMap;
pub struct Graph<N> {
nodes: HashMap<N, ~[N]>
nodes: HashMap<N, Vec<N>>
}
enum Mark {

View File

@ -68,7 +68,7 @@ impl ProcessBuilder {
pub fn exec(&self) -> CargoResult<()> {
let mut command = self.build_command();
command
.env(self.build_env())
.env(self.build_env().as_slice())
.stdout(InheritFd(1))
.stderr(InheritFd(2));
@ -84,7 +84,7 @@ impl ProcessBuilder {
pub fn exec_with_output(&self) -> CargoResult<ProcessOutput> {
let mut command = self.build_command();
command.env(self.build_env());
command.env(self.build_env().as_slice());
let output = try!(command.output().map_err(io_error));
@ -106,7 +106,7 @@ impl ProcessBuilder {
format!("{} {}", self.program, self.args.connect(" "))
}
fn build_env(&self) -> ~[(String, String)] {
fn build_env(&self) -> Vec<(String, String)> {
let mut ret = Vec::new();
for (key, val) in self.env.iter() {

View File

@ -80,8 +80,8 @@ pub struct CargoError {
impl Show for CargoError {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
match self.desc {
StaticDescription(string) => write!(f, "{}", string),
BoxedDescription(ref string) => write!(f, "{}", string)
StaticDescription(string) => try!(write!(f, "{}", string)),
BoxedDescription(ref string) => try!(write!(f, "{}", string))
};
write!(f, "; kind={}", self.kind)

View File

@ -5,7 +5,7 @@ use std::collections::HashMap;
use serialize::Decodable;
use core::source::{SourceId,GitKind};
use core::{Summary,Manifest,Target,Dependency,PackageId,Source};
use core::{Summary,Manifest,Target,Dependency,PackageId};
use util::{CargoResult,Require,simple_human,toml_error};
pub fn to_manifest(contents: &[u8], namespace: &Url) -> CargoResult<Manifest> {