From: Andre Bogus Date: Sun, 19 Feb 2017 23:45:34 +0000 (+0100) Subject: improved formatting for bonus points X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~9^2~133^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=271eff015d5b3dc26ba2da53658bc315e3363ad0;p=cargo.git improved formatting for bonus points --- diff --git a/src/cargo/sources/git/utils.rs b/src/cargo/sources/git/utils.rs index c8676d655..877752cea 100644 --- a/src/cargo/sources/git/utils.rs +++ b/src/cargo/sources/git/utils.rs @@ -595,7 +595,7 @@ pub fn fetch(repo: &git2::Repository, opts.remote_callbacks(cb) .download_tags(git2::AutotagOption::All); - network::with_retry(config, ||{ + network::with_retry(config, || { remote.fetch(&[refspec], Some(&mut opts), None) })?; Ok(()) @@ -605,12 +605,12 @@ pub fn fetch(repo: &git2::Repository, /// Clone a remote repository into a target directory. This is a simple utility function to get /// HEAD. When this is complete it should be equivalent to `git clone $url $target` pub fn clone(url: &str, target: &Path, config: &Config) -> CargoResult<()> { - let repo = git2::Repository::init(target).chain_error(||{ + let repo = git2::Repository::init(target).chain_error(|| { human(format!("Failed to create template directory `{}`", target.display())) })?; let refspec = "refs/heads/*:refs/heads/*"; - fetch(&repo, url, refspec, &config).chain_error(||{ + fetch(&repo, url, refspec, &config).chain_error(|| { human(format!("failed to fecth `{}`", url)) })?; let reference = "HEAD";