-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Clean up some style in Cargo #1278
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
Conversation
r? @huonw (rust_highfive has picked a reviewer for you, use r? to override) |
@bors: r+ e8aa |
⌛ Testing commit e8aa163 with merge f5fcb33... |
💔 Test failed - cargo-win-64 |
@bors: r=brson e3b14a2 |
@bors: r=brson e3b14a2 |
⌛ Testing commit e3b14a2 with merge 9362521... |
💔 Test failed - cargo-win-32 |
@bors: r=brson 96ef93c |
⌛ Testing commit 96ef93c with merge 1389f60... |
💔 Test failed - cargo-win-32 |
@bors: retry |
The current naming is [against our guidelines][guidelines] [guidelines]: https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md#gettersetter-apis
@bors: retry |
* Update to rust master * Remove many calls to `.as_slice` (deref coercions) * Remove `get_` prefixes
💔 Test failed - cargo-mac-64 |
"glob 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", | ||
"flate2 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", | ||
"git2 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", | ||
"glob 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", | ||
"hamcrest 0.1.0 (git+https://github.com/carllerche/hamcrest-rust.git)", | ||
"log 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | ||
"regex 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
latest regex is 0.1.14
Thanks, cargo compiled for me with: diff --git a/Cargo.lock b/Cargo.lock
index be59b02..32aa5e6 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4,23 +4,23 @@ version = "0.1.0"
dependencies = [
"advapi32-sys 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"curl 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
- "docopt 0.6.35 (registry+https://github.com/rust-lang/crates.io-index)",
+ "docopt 0.6.36 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"flate2 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"git2 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"glob 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"hamcrest 0.1.0 (git+https://github.com/carllerche/hamcrest-rust.git)",
"log 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
"registry 0.1.0",
"rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"semver 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
"tar 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"term 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "time 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -28,7 +28,7 @@ name = "advapi32-sys"
version = "0.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "winapi 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -42,9 +42,9 @@ version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"curl-sys 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -52,7 +52,7 @@ name = "curl-sys"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -60,10 +60,10 @@ dependencies = [
[[package]]
name = "docopt"
-version = "0.6.35"
+version = "0.6.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "regex 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -73,7 +73,7 @@ version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"log 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "regex 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -81,7 +81,7 @@ name = "flate2"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"miniz-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -97,7 +97,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libgit2-sys 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -112,15 +112,15 @@ source = "git+https://github.com/carllerche/hamcrest-rust.git#70d572f27ebbffb5a8
[[package]]
name = "kernel32-sys"
-version = "0.0.6"
+version = "0.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "winapi 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "libc"
-version = "0.1.1"
+version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@@ -176,7 +176,7 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gcc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -200,7 +200,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "regex"
-version = "0.1.13"
+version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@@ -231,18 +231,18 @@ name = "term"
version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "kernel32-sys 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "kernel32-sys 0.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "time"
-version = "0.1.15"
+version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gcc 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -255,7 +255,7 @@ dependencies = [
[[package]]
name = "url"
-version = "0.2.19"
+version = "0.2.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -264,6 +264,6 @@ dependencies = [
[[package]]
name = "winapi"
-version = "0.1.9"
+version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/src/bin/login.rs b/src/bin/login.rs
index e716af4..2726c93 100644
--- a/src/bin/login.rs
+++ b/src/bin/login.rs
@@ -30,7 +30,7 @@ pub fn execute(options: Options, config: &Config) -> CliResult<Option<()>> {
let token = match options.arg_token.clone() {
Some(token) => token,
None => {
- let err = (|:| {
+ let err = (|| {
let src = try!(SourceId::for_central(config));
let mut src = RegistrySource::new(&src, config);
try!(src.update());
diff --git a/src/cargo/core/registry.rs b/src/cargo/core/registry.rs
index 6f0dea3..adf05b0 100644
--- a/src/cargo/core/registry.rs
+++ b/src/cargo/core/registry.rs
@@ -160,7 +160,7 @@ impl<'a, 'b> PackageRegistry<'a, 'b> {
}
fn load(&mut self, source_id: &SourceId, kind: Kind) -> CargoResult<()> {
- (|:| {
+ (|| {
let mut source = source_id.load(self.config);
// Ensure the source has fetched all necessary remote data.
diff --git a/src/cargo/core/resolver/encode.rs b/src/cargo/core/resolver/encode.rs
index c5c4f65..9ef4a4f 100644
--- a/src/cargo/core/resolver/encode.rs
+++ b/src/cargo/core/resolver/encode.rs
@@ -26,7 +26,7 @@ impl EncodableResolve {
let packages = self.package.as_ref().unwrap_or(&packages);
{
- let mut register_pkg = |&mut: pkg: &EncodableDependency|
+ let mut register_pkg = |pkg: &EncodableDependency|
-> CargoResult<()> {
let pkgid = try!(pkg.to_package_id(default));
let precise = pkgid.source_id().precise()
@@ -44,7 +44,7 @@ impl EncodableResolve {
}
{
- let mut add_dependencies = |&mut: pkg: &EncodableDependency|
+ let mut add_dependencies = |pkg: &EncodableDependency|
-> CargoResult<()> {
let package_id = try!(pkg.to_package_id(default));
diff --git a/src/cargo/sources/git/utils.rs b/src/cargo/sources/git/utils.rs
index d5ea951..898f082 100644
--- a/src/cargo/sources/git/utils.rs
+++ b/src/cargo/sources/git/utils.rs
@@ -182,7 +182,7 @@ impl GitDatabase {
pub fn rev_for(&self, reference: &GitReference) -> CargoResult<GitRevision> {
let id = match *reference {
GitReference::Tag(ref s) => {
- try!((|:| {
+ try!((|| {
let refname = format!("refs/tags/{}", s);
let id = try!(self.repo.refname_to_id(&refname));
let obj = try!(self.repo.find_object(id, None));
@@ -193,7 +193,7 @@ impl GitDatabase {
}))
}
GitReference::Branch(ref s) => {
- try!((|:| {
+ try!((|| {
let b = try!(self.repo.find_branch(s, git2::BranchType::Local));
b.get().target().chain_error(|| {
human(format!("branch `{}` did not have a target", s))
diff --git a/src/cargo/sources/path.rs b/src/cargo/sources/path.rs
index 7401a07..cc54634 100644
--- a/src/cargo/sources/path.rs
+++ b/src/cargo/sources/path.rs
@@ -84,7 +84,7 @@ impl<'a, 'b> PathSource<'a, 'b> {
let include = try!(pkg.manifest().include().iter()
.map(|p| parse(p)).collect::<Result<Vec<_>, _>>());
- let mut filter = |&mut: p: &Path| {
+ let mut filter = |p: &Path| {
let relative_path = p.path_relative_from(&root).unwrap();
include.iter().any(|p| p.matches_path(&relative_path)) || {
include.len() == 0 && |
@bors: r=brson p=85b3f4d |
🙀 You have the wrong number! Please try again with |
@bors: r=brson 85b3f4d |
⌛ Testing commit 85b3f4d with merge d86b0b0... |
💔 Test failed - cargo-win-32 |
@bors: r=brson 5cfc0ca |
⌛ Testing commit 5cfc0ca with merge 9ca9c6b... |
💔 Test failed - cargo-win-32 |
@bors: r=brson 7565e8a |
⌛ Testing commit 7565e8a with merge dfa6ffd... |
💔 Test failed - cargo-win-32 |
* Update to rust master * Remove many calls to `.as_slice` (deref coercions) * Remove `get_` prefixes
☀️ Test successful - cargo-linux-32, cargo-linux-64, cargo-mac-32, cargo-mac-64, cargo-win-32, cargo-win-64 |
.as_slice
(deref coercions)get_
prefixes