intellij rust suggested fixes
authorEh2406 <YeomanYaacov@gmail.com>
Fri, 23 Feb 2018 23:27:53 +0000 (18:27 -0500)
committerEh2406 <YeomanYaacov@gmail.com>
Mon, 26 Feb 2018 22:29:17 +0000 (17:29 -0500)
(cherry picked from commit 24836e9)

61 files changed:
src/bin/bench.rs
src/bin/build.rs
src/bin/check.rs
src/bin/clean.rs
src/bin/doc.rs
src/bin/install.rs
src/bin/package.rs
src/bin/publish.rs
src/bin/run.rs
src/bin/rustc.rs
src/bin/rustdoc.rs
src/bin/test.rs
src/bin/update.rs
src/cargo/core/manifest.rs
src/cargo/core/package.rs
src/cargo/core/package_id.rs
src/cargo/core/package_id_spec.rs
src/cargo/core/registry.rs
src/cargo/core/resolver/encode.rs
src/cargo/core/source/source_id.rs
src/cargo/core/workspace.rs
src/cargo/lib.rs
src/cargo/ops/cargo_compile.rs
src/cargo/ops/cargo_new.rs
src/cargo/ops/cargo_output_metadata.rs
src/cargo/ops/cargo_package.rs
src/cargo/ops/cargo_rustc/compilation.rs
src/cargo/ops/cargo_rustc/context.rs
src/cargo/ops/cargo_rustc/custom_build.rs
src/cargo/ops/cargo_rustc/fingerprint.rs
src/cargo/ops/cargo_rustc/job.rs
src/cargo/ops/cargo_rustc/job_queue.rs
src/cargo/ops/cargo_rustc/layout.rs
src/cargo/ops/cargo_rustc/mod.rs
src/cargo/ops/registry.rs
src/cargo/ops/resolve.rs
src/cargo/sources/config.rs
src/cargo/sources/directory.rs
src/cargo/sources/git/source.rs
src/cargo/sources/git/utils.rs
src/cargo/sources/path.rs
src/cargo/sources/registry/index.rs
src/cargo/sources/registry/local.rs
src/cargo/sources/registry/mod.rs
src/cargo/sources/registry/remote.rs
src/cargo/util/config.rs
src/cargo/util/errors.rs
src/cargo/util/flock.rs
src/cargo/util/job.rs
src/cargo/util/process_builder.rs
src/cargo/util/read2.rs
src/cargo/util/rustc.rs
src/cargo/util/toml/mod.rs
src/crates-io/lib.rs
tests/testsuite/cargotest/support/git.rs
tests/testsuite/cargotest/support/mod.rs
tests/testsuite/cargotest/support/paths.rs
tests/testsuite/directory.rs
tests/testsuite/generate_lockfile.rs
tests/testsuite/install.rs
tests/testsuite/patch.rs

index e00002ebe97f73e1c8db5eaf1ee4801b31096763..f42e5a73eb64339c4b9c680fad3fa6d18b4cfe68 100644 (file)
@@ -121,13 +121,13 @@ pub fn execute(mut options: Options, config: &mut Config) -> CliResult {
         no_fail_fast: options.flag_no_fail_fast,
         only_doc: false,
         compile_opts: ops::CompileOptions {
-            config: config,
+            config,
             jobs: options.flag_jobs,
             target: options.flag_target.as_ref().map(|s| &s[..]),
             features: &options.flag_features,
             all_features: options.flag_all_features,
             no_default_features: options.flag_no_default_features,
-            spec: spec,
+            spec,
             release: true,
             mode: ops::CompileMode::Bench,
             filter: ops::CompileFilter::new(options.flag_lib,
index 889052068e477e5cb4bfcfd295d37cd9eb04efed..9dd2fa24efa46b8b45a534edaba488ab29a3e7d7 100644 (file)
@@ -105,13 +105,13 @@ pub fn execute(options: Options, config: &mut Config) -> CliResult {
                                     &options.flag_package)?;
 
     let opts = CompileOptions {
-        config: config,
+        config,
         jobs: options.flag_jobs,
         target: options.flag_target.as_ref().map(|t| &t[..]),
         features: &options.flag_features,
         all_features: options.flag_all_features,
         no_default_features: options.flag_no_default_features,
-        spec: spec,
+        spec,
         mode: ops::CompileMode::Build,
         release: options.flag_release,
         filter: ops::CompileFilter::new(options.flag_lib,
index 98172a28c1bdc196558fd72cd09d2c91ef68c3e4..53e8128e1632c6220d46cb2b4192fcbaf4ae8c26 100644 (file)
@@ -121,14 +121,14 @@ pub fn execute(options: Options, config: &mut Config) -> CliResult {
         };
 
     let opts = CompileOptions {
-        config: config,
+        config,
         jobs: options.flag_jobs,
         target: options.flag_target.as_ref().map(|t| &t[..]),
         features: &options.flag_features,
         all_features: options.flag_all_features,
         no_default_features: options.flag_no_default_features,
-        spec: spec,
-        mode: ops::CompileMode::Check{test:test},
+        spec,
+        mode: ops::CompileMode::Check{test },
         release: options.flag_release,
         filter: ops::CompileFilter::new(options.flag_lib,
                                         &options.flag_bin, options.flag_bins,
index 446b5e502b27e90c4ffc3374ce50a98d0e6ac75b..fc226b4adc661c7671ca4bc181959435b1ce266a 100644 (file)
@@ -56,7 +56,7 @@ pub fn execute(options: Options, config: &mut Config) -> CliResult {
 
     let root = find_root_manifest_for_wd(options.flag_manifest_path, config.cwd())?;
     let opts = ops::CleanOptions {
-        config: config,
+        config,
         spec: &options.flag_package,
         target: options.flag_target.as_ref().map(|s| &s[..]),
         release: options.flag_release,
index 6e17836963c2d0d1cafc61f6b33c2f113b8aea39..8c6b929fee934fccb1e5bb1260961f69c6a2fb76 100644 (file)
@@ -98,13 +98,13 @@ pub fn execute(options: Options, config: &mut Config) -> CliResult {
     let doc_opts = ops::DocOptions {
         open_result: options.flag_open,
         compile_opts: ops::CompileOptions {
-            config: config,
+            config,
             jobs: options.flag_jobs,
             target: options.flag_target.as_ref().map(|t| &t[..]),
             features: &options.flag_features,
             all_features: options.flag_all_features,
             no_default_features: options.flag_no_default_features,
-            spec: spec,
+            spec,
             filter: ops::CompileFilter::new(options.flag_lib,
                                             &options.flag_bin, options.flag_bins,
                                             &empty, false,
index a0c000202fc6d40cc612964504fe896c702ce246..af18a839c59364f768398e78b9736261ff5e4ec7 100644 (file)
@@ -118,7 +118,7 @@ pub fn execute(options: Options, config: &mut Config) -> CliResult {
                      &options.flag_z)?;
 
     let compile_opts = ops::CompileOptions {
-        config: config,
+        config,
         jobs: options.flag_jobs,
         target: None,
         features: &options.flag_features,
index 9c91583d0e8184f59c514410fa9bb096ff2acb09..4db0db86f460bc1300bbd832322d127f8341472c 100644 (file)
@@ -54,7 +54,7 @@ pub fn execute(options: Options, config: &mut Config) -> CliResult {
     let root = find_root_manifest_for_wd(options.flag_manifest_path, config.cwd())?;
     let ws = Workspace::new(&root, config)?;
     ops::package(&ws, &ops::PackageOpts {
-        config: config,
+        config,
         verify: !options.flag_no_verify,
         list: options.flag_list,
         check_metadata: !options.flag_no_metadata,
index 7294ea70ee61fa6c3b4003c422955564d4c902eb..71d7efc537bbc7325cf63fc4610ff7f26416db48 100644 (file)
@@ -97,17 +97,17 @@ about this warning.";
     let root = find_root_manifest_for_wd(flag_manifest_path.clone(), config.cwd())?;
     let ws = Workspace::new(&root, config)?;
     ops::publish(&ws, &ops::PublishOpts {
-        config: config,
-        token: token,
+        config,
+        token,
         index:
             if host.clone().is_none() || host.clone().unwrap().is_empty() { index }
             else { config.shell().warn(&msg)?; host },  // TODO: Deprecated, remove
         verify: !no_verify,
-        allow_dirty: allow_dirty,
+        allow_dirty,
         target: target.as_ref().map(|t| &t[..]),
-        jobs: jobs,
-        dry_run: dry_run,
-        registry: registry,
+        jobs,
+        dry_run,
+        registry,
     })?;
     Ok(())
 }
index 48939d6547e7896f366b1b432b0b05947d38d06b..92ccb90dbc7be947ee57a2e84fb1a98d82dd0f9e 100644 (file)
@@ -86,13 +86,13 @@ pub fn execute(options: Options, config: &mut Config) -> CliResult {
     let spec = Packages::Packages(&packages);
 
     let compile_opts = ops::CompileOptions {
-        config: config,
+        config,
         jobs: options.flag_jobs,
         target: options.flag_target.as_ref().map(|t| &t[..]),
         features: &options.flag_features,
         all_features: options.flag_all_features,
         no_default_features: options.flag_no_default_features,
-        spec: spec,
+        spec,
         release: options.flag_release,
         mode: ops::CompileMode::Build,
         filter: if examples.is_empty() && bins.is_empty() {
index 98d7c410de41aa8f3713a84de2ca5b9e77e6d00d..a73e47ddcff6e41215e9f7627a3114ceb5c73ffb 100644 (file)
@@ -113,14 +113,14 @@ pub fn execute(options: Options, config: &mut Config) -> CliResult {
     let spec = options.flag_package.map_or_else(Vec::new, |s| vec![s]);
 
     let opts = CompileOptions {
-        config: config,
+        config,
         jobs: options.flag_jobs,
         target: options.flag_target.as_ref().map(|t| &t[..]),
         features: &options.flag_features,
         all_features: options.flag_all_features,
         no_default_features: options.flag_no_default_features,
         spec: Packages::Packages(&spec),
-        mode: mode,
+        mode,
         release: options.flag_release,
         filter: ops::CompileFilter::new(options.flag_lib,
                                         &options.flag_bin, options.flag_bins,
index 156a6b86796a53bb755707bd3ef6abe7afdede05..f10354619a9cb74386311bd115daf730f6de6dc9 100644 (file)
@@ -99,7 +99,7 @@ pub fn execute(options: Options, config: &mut Config) -> CliResult {
     let doc_opts = ops::DocOptions {
         open_result: options.flag_open,
         compile_opts: ops::CompileOptions {
-            config: config,
+            config,
             jobs: options.flag_jobs,
             target: options.flag_target.as_ref().map(|t| &t[..]),
             features: &options.flag_features,
index d13e9edbc624388d4e39c38c80fd682ec25923aa..1262894ceb4363056a29e79ebe6234d9d6e5b08b 100644 (file)
@@ -159,16 +159,16 @@ pub fn execute(mut options: Options, config: &mut Config) -> CliResult {
         no_fail_fast: options.flag_no_fail_fast,
         only_doc: options.flag_doc,
         compile_opts: ops::CompileOptions {
-            config: config,
+            config,
             jobs: options.flag_jobs,
             target: options.flag_target.as_ref().map(|s| &s[..]),
             features: &options.flag_features,
             all_features: options.flag_all_features,
             no_default_features: options.flag_no_default_features,
-            spec: spec,
+            spec,
             release: options.flag_release,
-            mode: mode,
-            filter: filter,
+            mode,
+            filter,
             message_format: options.flag_message_format,
             target_rustdoc_args: None,
             target_rustc_args: None,
index 1e7f92b535abe3b1c1a8d59425cd191be52f23d5..1de78a23eef71e3204ec4f4a454db7210d28a97e 100644 (file)
@@ -74,7 +74,7 @@ pub fn execute(options: Options, config: &mut Config) -> CliResult {
         aggressive: options.flag_aggressive,
         precise: options.flag_precise.as_ref().map(|s| &s[..]),
         to_update: &options.flag_package,
-        config: config,
+        config,
     };
 
     let ws = Workspace::new(&root, config)?;
index ab90cee0915e22a165740a71650be241b9e27baf..0ebe5f533cd93cb81c50898f9852b9602c4d29f0 100644 (file)
@@ -275,22 +275,22 @@ impl Manifest {
                im_a_teapot: Option<bool>,
                original: Rc<TomlManifest>) -> Manifest {
         Manifest {
-            summary: summary,
-            targets: targets,
+            summary,
+            targets,
             warnings: Vec::new(),
-            exclude: exclude,
-            include: include,
-            links: links,
-            metadata: metadata,
-            profiles: profiles,
-            publish: publish,
-            replace: replace,
-            patch: patch,
-            workspace: workspace,
-            features: features,
-            epoch: epoch,
-            original: original,
-            im_a_teapot: im_a_teapot,
+            exclude,
+            include,
+            links,
+            metadata,
+            profiles,
+            publish,
+            replace,
+            patch,
+            workspace,
+            features,
+            epoch,
+            original,
+            im_a_teapot,
         }
     }
 
@@ -372,10 +372,10 @@ impl VirtualManifest {
                workspace: WorkspaceConfig,
                profiles: Profiles) -> VirtualManifest {
         VirtualManifest {
-            replace: replace,
-            patch: patch,
-            workspace: workspace,
-            profiles: profiles,
+            replace,
+            patch,
+            workspace,
+            profiles,
         }
     }
 
@@ -430,7 +430,7 @@ impl Target {
         Target {
             kind: TargetKind::Bin,
             name: name.to_string(),
-            required_features: required_features,
+            required_features,
             doc: true,
             ..Target::with_path(src_path)
         }
@@ -459,9 +459,9 @@ impl Target {
         };
 
         Target {
-            kind: kind,
+            kind,
             name: name.to_string(),
-            required_features: required_features,
+            required_features,
             benched: false,
             ..Target::with_path(src_path)
         }
@@ -472,7 +472,7 @@ impl Target {
         Target {
             kind: TargetKind::Test,
             name: name.to_string(),
-            required_features: required_features,
+            required_features,
             benched: false,
             ..Target::with_path(src_path)
         }
@@ -483,7 +483,7 @@ impl Target {
         Target {
             kind: TargetKind::Bench,
             name: name.to_string(),
-            required_features: required_features,
+            required_features,
             tested: false,
             ..Target::with_path(src_path)
         }
index e0c54c03af63fe1f5c9ad59e06ecd3687e4bd918..252b7ac836e1c068a953e4c22698d242c64a4faa 100644 (file)
@@ -58,9 +58,9 @@ impl ser::Serialize for Package {
             name: package_id.name(),
             version: &package_id.version().to_string(),
             id: package_id,
-            license: license,
-            license_file: license_file,
-            description: description,
+            license,
+            license_file,
+            description,
             source: summary.source_id(),
             dependencies: summary.dependencies(),
             targets: self.manifest.targets(),
@@ -75,7 +75,7 @@ impl Package {
     pub fn new(manifest: Manifest,
                manifest_path: &Path) -> Package {
         Package {
-            manifest: manifest,
+            manifest,
             manifest_path: manifest_path.to_path_buf(),
         }
     }
index 90879855581d4b3866b0db700403925582e77dd4..ffb4330c627c3ab0999e8b9a21cb20da45b5c8aa 100644 (file)
@@ -64,8 +64,8 @@ impl<'de> de::Deserialize<'de> for PackageId {
         Ok(PackageId {
             inner: Arc::new(PackageIdInner {
                 name: name.to_string(),
-                version: version,
-                source_id: source_id,
+                version,
+                source_id,
             }),
         })
     }
index 318fc0b3ed8c93b79a0888ac2aff21c09d760956..be1170be4a7b13573be885fa7689dd4022eb9d59 100644 (file)
@@ -40,7 +40,7 @@ impl PackageIdSpec {
         }
         Ok(PackageIdSpec {
             name: name.to_string(),
-            version: version,
+            version,
             url: None,
         })
     }
@@ -100,8 +100,8 @@ impl PackageIdSpec {
             }
         };
         Ok(PackageIdSpec {
-            name: name,
-            version: version,
+            name,
+            version,
             url: Some(url),
         })
     }
index 1a18bd011e7638251172485e816547365f522abe..31758f8415b6347670c921bff45d77494dcecc5c 100644 (file)
@@ -110,7 +110,7 @@ impl<'cfg> PackageRegistry<'cfg> {
             sources: SourceMap::new(),
             source_ids: HashMap::new(),
             overrides: Vec::new(),
-            source_config: source_config,
+            source_config,
             locked: HashMap::new(),
             patches: HashMap::new(),
             patches_locked: false,
index a0cf0bac081e5a9bf0da29ea8f2521646303df61..bf985e4c81574c693e63692066aaa8189eb6d26e 100644 (file)
@@ -179,10 +179,10 @@ impl EncodableResolve {
             graph: g,
             empty_features: HashSet::new(),
             features: HashMap::new(),
-            replacements: replacements,
-            checksums: checksums,
-            metadata: metadata,
-            unused_patches: unused_patches,
+            replacements,
+            checksums,
+            metadata,
+            unused_patches,
         })
     }
 }
@@ -372,8 +372,8 @@ impl<'a, 'cfg> ser::Serialize for WorkspaceResolve<'a, 'cfg> {
         EncodableResolve {
             package: Some(encodable),
             root: None,
-            metadata: metadata,
-            patch: patch,
+            metadata,
+            patch,
         }.serialize(s)
     }
 }
@@ -399,7 +399,7 @@ fn encodable_resolve_node(id: &PackageId, resolve: &Resolve)
         version: id.version().to_string(),
         source: encode_source(id.source_id()),
         dependencies: deps,
-        replace: replace,
+        replace,
     }
 }
 
index 1651f5306897c77b571cee7f71af9e322578b042..9135af41fbf6afd82462d193b34049ac06836a5b 100644 (file)
@@ -70,9 +70,9 @@ impl SourceId {
     fn new(kind: Kind, url: Url) -> CargoResult<SourceId> {
         let source_id = SourceId {
             inner: Arc::new(SourceIdInner {
-                kind: kind,
+                kind,
                 canonical_url: git::canonicalize_url(&url)?,
-                url: url,
+                url,
                 precise: None,
                 name: None,
             }),
@@ -191,7 +191,7 @@ impl SourceId {
             inner: Arc::new(SourceIdInner {
                 kind: Kind::Registry,
                 canonical_url: git::canonicalize_url(&url)?,
-                url: url,
+                url,
                 precise: None,
                 name: Some(key.to_string()),
             }),
@@ -524,6 +524,6 @@ mod tests {
 
         let foo = Kind::Git(GitReference::Branch("foo".to_string()));
         let s3 = SourceId::new(foo, loc).unwrap();
-        assert!(s1 != s3);
+        assert_ne!(s1, s3);
     }
 }
index 5d21dd8d41a6919499b8f916af8c302e258e73be..63ecc7b3fe9756da673c5ab300fcf36991d7729e 100644 (file)
@@ -125,14 +125,14 @@ impl<'cfg> Workspace<'cfg> {
         let target_dir = config.target_dir()?;
 
         let mut ws = Workspace {
-            config: config,
+            config,
             current_manifest: manifest_path.to_path_buf(),
             packages: Packages {
-                config: config,
+                config,
                 packages: HashMap::new(),
             },
             root_manifest: None,
-            target_dir: target_dir,
+            target_dir,
             members: Vec::new(),
             default_members: Vec::new(),
             is_ephemeral: false,
@@ -162,10 +162,10 @@ impl<'cfg> Workspace<'cfg> {
                      target_dir: Option<Filesystem>,
                      require_optional_deps: bool) -> CargoResult<Workspace<'cfg>> {
         let mut ws = Workspace {
-            config: config,
+            config,
             current_manifest: package.manifest_path().to_path_buf(),
             packages: Packages {
-                config: config,
+                config,
                 packages: HashMap::new(),
             },
             root_manifest: None,
@@ -173,7 +173,7 @@ impl<'cfg> Workspace<'cfg> {
             members: Vec::new(),
             default_members: Vec::new(),
             is_ephemeral: true,
-            require_optional_deps: require_optional_deps,
+            require_optional_deps,
         };
         {
             let key = ws.current_manifest.parent().unwrap();
index 41615e3d87d531966d1929040500cd368ffe423c..dc1dcd6a5e8e95ba3883e8e9096458532748faac 100644 (file)
@@ -216,7 +216,7 @@ pub fn version() -> VersionInfo {
                 pre_release: option_env_str!("CARGO_PKG_VERSION_PRE"),
                 cfg_info: Some(CfgInfo {
                     release_channel: option_env_str!("CFG_RELEASE_CHANNEL").unwrap(),
-                    commit_info: commit_info,
+                    commit_info,
                 }),
             }
         },
index cc3400268f96fbc9dc94cea93c7899c515e971ee..026d4fdc60940076ff3b66947880d9216c54c834 100644 (file)
@@ -70,14 +70,14 @@ impl<'a> CompileOptions<'a> {
     pub fn default(config: &'a Config, mode: CompileMode) -> CompileOptions<'a>
     {
         CompileOptions {
-            config: config,
+            config,
             jobs: None,
             target: None,
             features: &[],
             all_features: false,
             no_default_features: false,
             spec: ops::Packages::Packages(&[]),
-            mode: mode,
+            mode,
             release: false,
             filter: CompileFilter::Default { required_features_filterable: false },
             message_format: MessageFormat::Human,
@@ -455,7 +455,7 @@ fn generate_auto_targets<'a>(mode: CompileMode, targets: &'a [Target],
             targets.iter().filter(|t| t.benched()).map(|t| {
                 BuildProposal {
                     target: t,
-                    profile: profile,
+                    profile,
                     required: !required_features_filterable,
                 }
             }).collect::<Vec<_>>()
@@ -489,7 +489,7 @@ fn generate_auto_targets<'a>(mode: CompileMode, targets: &'a [Target],
                 t.is_bin() || t.is_lib()
             }).map(|t| BuildProposal {
                 target: t,
-                profile: profile,
+                profile,
                 required: !required_features_filterable,
             }).collect()
         }
@@ -501,7 +501,7 @@ fn generate_auto_targets<'a>(mode: CompileMode, targets: &'a [Target],
                 )
             }).map(|t| BuildProposal {
                 target: t,
-                profile: profile,
+                profile,
                 required: !required_features_filterable,
             }).collect()
         }
@@ -510,7 +510,7 @@ fn generate_auto_targets<'a>(mode: CompileMode, targets: &'a [Target],
                 if t.doctested() {
                     return vec![BuildProposal {
                         target: t,
-                        profile: profile,
+                        profile,
                         required: !required_features_filterable,
                     }];
                 }
@@ -532,7 +532,7 @@ fn propose_indicated_targets<'a>(pkg: &'a Package,
             let result = pkg.targets().iter().filter(|t| is_expected_kind(t)).map(|t| {
                 BuildProposal {
                     target: t,
-                    profile: profile,
+                    profile,
                     required: false,
                 }
             });
@@ -561,7 +561,7 @@ fn propose_indicated_targets<'a>(pkg: &'a Package,
                 debug!("found {} `{}`", desc, name);
                 targets.push(BuildProposal {
                     target: t,
-                    profile: profile,
+                    profile,
                     required: true,
                 });
             }
@@ -650,7 +650,7 @@ fn generate_targets<'a>(pkg: &'a Package,
                 if let Some(t) = pkg.targets().iter().find(|t| t.is_lib()) {
                     targets.push(BuildProposal {
                         target: t,
-                        profile: profile,
+                        profile,
                         required: true,
                     });
                 } else if !all_targets {
@@ -721,7 +721,7 @@ fn scrape_build_config(config: &Config,
     let mut base = ops::BuildConfig {
         host_triple: config.rustc()?.host.clone(),
         requested_target: target.clone(),
-        jobs: jobs,
+        jobs,
         ..Default::default()
     };
     base.host = scrape_target_config(config, &base.host_triple)?;
index aaaa69e2176c572d940d64b4c58fb4ac3e3666f2..a1291e75b03346e8223b4d3167a6ecfbdee8a315 100644 (file)
@@ -291,7 +291,7 @@ pub fn new(opts: &NewOptions, config: &Config) -> CargoResult<()> {
     let mkopts = MkOptions {
         version_control: opts.version_control,
         path: &path,
-        name: name,
+        name,
         source_files: vec![plan_new_source_file(opts.kind.is_bin(), name.to_string())],
         bin: opts.kind.is_bin(),
     };
@@ -580,8 +580,8 @@ fn global_config(config: &Config) -> CargoResult<CargoNewConfig> {
         None => None
     };
     Ok(CargoNewConfig {
-        name: name,
-        email: email,
+        name,
+        email,
         version_control: vcs,
     })
 }
index 1b6da788f20d6e64db52a94af99a0acdd83119ef..0e44252547c484a4619b4ea189a738705568e9a6 100644 (file)
@@ -59,10 +59,10 @@ fn metadata_full(ws: &Workspace,
                            .collect::<CargoResult<Vec<_>>>()?;
 
     Ok(ExportInfo {
-        packages: packages,
+        packages,
         workspace_members: ws.members().map(|pkg| pkg.package_id().clone()).collect(),
         resolve: Some(MetadataResolve{
-            resolve: resolve,
+            resolve,
             root: ws.current_opt().map(|pkg| pkg.package_id().clone()),
         }),
         target_directory: ws.target_dir().display().to_string(),
@@ -102,7 +102,7 @@ fn serialize_resolve<S>(resolve: &Resolve, s: S) -> Result<S::Ok, S::Error>
 
     resolve.iter().map(|id| {
         Node {
-            id: id,
+            id,
             dependencies: resolve.deps(id).collect(),
         }
     }).collect::<Vec<_>>().serialize(s)
index 9562b7abae5c48cf528d9d32ebc28849d7b612ce..0dc3aedd5dc634d34f379e94a4fb4db22cc78ee1 100644 (file)
@@ -292,7 +292,7 @@ fn run_verify(ws: &Workspace, tar: &FileLock, opts: &PackageOpts) -> CargoResult
     let ws = Workspace::ephemeral(new_pkg, config, None, true)?;
 
     ops::compile_ws(&ws, None, &ops::CompileOptions {
-        config: config,
+        config,
         jobs: opts.jobs,
         target: opts.target,
         features: &[],
index 88f82516bd4ddfa28913abf120e63c3f36d09fb1..7cb781e0f2da654e74460ac410dd07c11c07f800 100644 (file)
@@ -80,7 +80,7 @@ impl<'cfg> Compilation<'cfg> {
             to_doc_test: Vec::new(),
             cfgs: HashMap::new(),
             rustdocflags: HashMap::new(),
-            config: config,
+            config,
             target: String::new(),
             target_runner: LazyCell::new(),
         }
index 325d743463787436a8f438a6ec25b92523e60bd8..24985a190fef88078aaa8b6254c028ee534a6e94 100644 (file)
@@ -175,26 +175,26 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
         };
 
         Ok(Context {
-            ws: ws,
+            ws,
             host: host_layout,
             target: target_layout,
-            resolve: resolve,
-            packages: packages,
-            config: config,
+            resolve,
+            packages,
+            config,
             target_info: TargetInfo::default(),
             host_info: TargetInfo::default(),
             compilation: Compilation::new(config),
             build_state: Arc::new(BuildState::new(&build_config)),
-            build_config: build_config,
+            build_config,
             fingerprints: HashMap::new(),
-            profiles: profiles,
+            profiles,
             compiled: HashSet::new(),
             build_scripts: HashMap::new(),
             build_explicit_deps: HashMap::new(),
             links: Links::new(),
             used_in_plugin: HashSet::new(),
             incremental_env,
-            jobserver: jobserver,
+            jobserver,
             build_script_overridden: HashSet::new(),
 
             // TODO: Pre-Calculate these with a topo-sort, rather than lazy-calculating
@@ -346,7 +346,7 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
         }
 
         let cfg = if has_cfg_and_sysroot {
-            Some(try!(lines.map(Cfg::from_str).collect()))
+            Some(lines.map(Cfg::from_str).collect::<CargoResult<_>>()?)
         } else {
             None
         };
@@ -819,7 +819,7 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
                 Ok(pkg) => {
                     pkg.targets().iter().find(|t| t.is_lib()).map(|t| {
                         let unit = Unit {
-                            pkg: pkg,
+                            pkg,
                             target: t,
                             profile: self.lib_or_check_profile(unit, t),
                             kind: unit.kind.for_target(t),
index 95940bfcb1343abceeace7d7b3b8ad17eafc32e5..6e7ff4b86ae5234c0f5a2d1945ebccf75a63b1a6 100644 (file)
@@ -331,7 +331,7 @@ impl BuildState {
         }
         BuildState {
             outputs: Mutex::new(HashMap::new()),
-            overrides: overrides,
+            overrides,
         }
     }
 
@@ -416,14 +416,14 @@ impl BuildOutput {
         }
 
         Ok(BuildOutput {
-            library_paths: library_paths,
-            library_links: library_links,
-            cfgs: cfgs,
-            env: env,
-            metadata: metadata,
-            rerun_if_changed: rerun_if_changed,
-            rerun_if_env_changed: rerun_if_env_changed,
-            warnings: warnings,
+            library_paths,
+            library_links,
+            cfgs,
+            env,
+            metadata,
+            rerun_if_changed,
+            rerun_if_env_changed,
+            warnings,
         })
     }
 
index 3080cee3dda2dc25d6ea91f34806e8c083a8d42d..fa4005486dce02d04cc3d3d580efce38bf402871 100644 (file)
@@ -419,7 +419,7 @@ fn calculate<'a, 'cfg>(cx: &mut Context<'a, 'cfg>, unit: &Unit<'a>)
         // actually affect the output artifact so there's no need to hash it.
         path: util::hash_u64(&super::path_args(cx, unit).0),
         features: format!("{:?}", cx.resolve.features_sorted(unit.pkg.package_id())),
-        deps: deps,
+        deps,
         local: vec![local],
         memoized_hash: Mutex::new(None),
         epoch: unit.pkg.manifest().epoch(),
@@ -473,7 +473,7 @@ pub fn prepare_build_cmd<'a, 'cfg>(cx: &mut Context<'a, 'cfg>, unit: &Unit<'a>)
         path: 0,
         features: String::new(),
         deps: Vec::new(),
-        local: local,
+        local,
         memoized_hash: Mutex::new(None),
         epoch: Epoch::Epoch2015,
         rustflags: Vec::new(),
index 219a6d4374968b67d34204184b766141b2730c58..cb49d07d8dff49f64aad026b8771a0186e319f63 100644 (file)
@@ -47,7 +47,7 @@ impl Work {
 impl Job {
     /// Create a new job representing a unit of work.
     pub fn new(dirty: Work, fresh: Work) -> Job {
-        Job { dirty: dirty, fresh: fresh }
+        Job { dirty, fresh }
     }
 
     /// Consumes this job by running it, returning the result of the
index 281f057aba12b403db9cbdd3391a1b1560acbdc4..6613404cd9988c69b42d8c95e95a2ee5e44f8628 100644 (file)
@@ -81,8 +81,8 @@ impl<'a> JobQueue<'a> {
         let (tx, rx) = channel();
         JobQueue {
             queue: DependencyQueue::new(),
-            tx: tx,
-            rx: rx,
+            tx,
+            rx,
             active: 0,
             pending: HashMap::new(),
             compiled: HashSet::new(),
index c5a6b875daaf75803c3d081358d9b09dd3613fbc..23a7490d9c226d5c4b5720b087f983d135e75a28 100644 (file)
@@ -117,7 +117,7 @@ impl Layout {
             incremental: root.join("incremental"),
             fingerprint: root.join(".fingerprint"),
             examples: root.join("examples"),
-            root: root,
+            root,
             _lock: lock,
         })
     }
index ec97e81b2ccdfa62c25d60008d67682ca397f22a..6cfb6e1e460f936ee013270d35508971d2924c1d 100644 (file)
@@ -149,9 +149,9 @@ pub fn compile_targets<'a, 'cfg: 'a>(ws: &Workspace<'cfg>,
         };
         targets.iter().map(move |&(target, profile)| {
             Unit {
-                pkg: pkg,
-                target: target,
-                profile: profile,
+                pkg,
+                target,
+                profile,
                 kind: if target.for_host() {Kind::Host} else {default_kind},
             }
         })
@@ -576,9 +576,9 @@ fn link_targets<'a, 'cfg>(cx: &mut Context<'a, 'cfg>,
                 package_id: &package_id,
                 target: &target,
                 profile: &profile,
-                features: features,
+                features,
                 filenames: destinations,
-                fresh: fresh,
+                fresh,
             });
         }
         Ok(())
index daf80a6241e4105277403a65adada781b6b36a46..5f29d3e5ea959cb3efdc66f307a910e852a2cf57 100644 (file)
@@ -180,7 +180,7 @@ fn transmit(config: &Config,
     let publish = registry.publish(&NewCrate {
         name: pkg.name().to_string(),
         vers: pkg.version().to_string(),
-        deps: deps,
+        deps,
         features: pkg.summary().features().clone(),
         authors: authors.clone(),
         description: description.clone(),
@@ -241,8 +241,8 @@ pub fn registry_configuration(config: &Config,
     };
 
     Ok(RegistryConfig {
-        index: index,
-        token: token
+        index,
+        token
     })
 }
 
index 8a49de85dc45299c0ff117dfd1915cdb8af74264..a4c754c3fc1fb3c42d9e5544522d813a077160bb 100644 (file)
@@ -234,7 +234,7 @@ pub fn resolve_with_previous<'a>(registry: &mut PackageRegistry,
             // for any other packages specified with `-p`.
             Method::Required { dev_deps, .. } => {
                 let base = Method::Required {
-                    dev_deps: dev_deps,
+                    dev_deps,
                     features: &[],
                     uses_default_features: true,
                 };
index 98361ddf03a4efddb307d88375ae6802b3f9bf58..5db68efd5b302d97b0c86ab0046bc0e98175c2d5 100644 (file)
@@ -56,7 +56,7 @@ impl<'cfg> SourceConfigMap<'cfg> {
         let mut base = SourceConfigMap {
             cfgs: HashMap::new(),
             id2name: HashMap::new(),
-            config: config,
+            config,
         };
         base.add("crates-io", SourceConfig {
             id: SourceId::crates_io(config)?,
@@ -208,7 +208,7 @@ restore the source replacement configuration to continue the build
 
         self.add(name, SourceConfig {
             id: src,
-            replace_with: replace_with,
+            replace_with,
         });
 
         return Ok(());
index 04df0a5ba627e834b14982609d0c5538e11f1d98..97cf4242d0a03ce6a0faa884d2ddf1de9f5e28a7 100644 (file)
@@ -33,7 +33,7 @@ impl<'cfg> DirectorySource<'cfg> {
         DirectorySource {
             source_id: id.clone(),
             root: path.to_path_buf(),
-            config: config,
+            config,
             packages: HashMap::new(),
         }
     }
index 0ec9c1697782e9923bd071c9fb5ca13b2c95157f..6d3d878a69e2ab0ce05d31b09635bd1df92fd48e 100644 (file)
@@ -37,13 +37,13 @@ impl<'cfg> GitSource<'cfg> {
         };
 
         let source = GitSource {
-            remote: remote,
-            reference: reference,
+            remote,
+            reference,
             source_id: source_id.clone(),
             path_source: None,
             rev: None,
-            ident: ident,
-            config: config,
+            ident,
+            config,
         };
 
         Ok(source)
index 6fe8fad741b6eab2ccfa0ff3ceb7e667bbdc14e8..f7ae61619b230112252504123ee96cbbdd428422 100644 (file)
@@ -109,7 +109,7 @@ impl GitRemote {
         Ok(GitDatabase {
             remote: self.clone(),
             path: into.to_path_buf(),
-            repo: repo,
+            repo,
         })
     }
 
@@ -118,7 +118,7 @@ impl GitRemote {
         Ok(GitDatabase {
             remote: self.clone(),
             path: db_path.to_path_buf(),
-            repo: repo,
+            repo,
         })
     }
 
@@ -210,9 +210,9 @@ impl<'a> GitCheckout<'a> {
     {
         GitCheckout {
             location: path.to_path_buf(),
-            database: database,
-            revision: revision,
-            repo: repo,
+            database,
+            revision,
+            repo,
         }
     }
 
index 9148ccb0f8927bddd4b1d75dc8fe967db12f8ac6..87a156c995e94968cf3c237dd626f6180c8ab7ce 100644 (file)
@@ -34,7 +34,7 @@ impl<'cfg> PathSource<'cfg> {
             path: path.to_path_buf(),
             updated: false,
             packages: Vec::new(),
-            config: config,
+            config,
             recursive: false,
         }
     }
index 710c8ac8982d89c5091c28bf50d7e280bfea7a0d..d3135bac365c8510c517da7019dbf89a7c826658 100644 (file)
@@ -31,8 +31,8 @@ impl<'cfg> RegistryIndex<'cfg> {
             path: path.clone(),
             cache: HashMap::new(),
             hashes: HashMap::new(),
-            config: config,
-            locked: locked,
+            config,
+            locked,
         }
     }
 
index d4d67a229b38ac539fbb7545f9e15e5f68899370..73f6f719bae020f3a5829bcf1e9696d05bc87a4c 100644 (file)
@@ -25,7 +25,7 @@ impl<'cfg> LocalRegistry<'cfg> {
             src_path: config.registry_source_path().join(name),
             index_path: Filesystem::new(root.join("index")),
             root: Filesystem::new(root.to_path_buf()),
-            config: config,
+            config,
         }
     }
 }
index e7edf91f1692fdd0b6745d2b57b9f28088ca7465..93ff9a8666eca416981333185ad842ffa020669b 100644 (file)
@@ -288,15 +288,15 @@ impl<'cfg> RegistrySource<'cfg> {
            index_locked: bool) -> RegistrySource<'cfg> {
         RegistrySource {
             src_path: config.registry_source_path().join(name),
-            config: config,
+            config,
             source_id: source_id.clone(),
             updated: false,
             index: index::RegistryIndex::new(source_id,
                                              ops.index_path(),
                                              config,
                                              index_locked),
-            index_locked: index_locked,
-            ops: ops,
+            index_locked,
+            ops,
         }
     }
 
index 331183e6d1d4a268b2f29076bcf499c436716764..47f940f9274632f1a092799eb82d49efb566ae97 100644 (file)
@@ -36,7 +36,7 @@ impl<'cfg> RemoteRegistry<'cfg> {
             index_path: config.registry_index_path().join(name),
             cache_path: config.registry_cache_path().join(name),
             source_id: source_id.clone(),
-            config: config,
+            config,
             tree: RefCell::new(None),
             repo: LazyCell::new(),
             head: Cell::new(None),
index 8d1d75e8613e5e1ae7b9a878ed67765223d3b898..588ad3592f29b13f5dce476a384ae77c67c5f4d2 100644 (file)
@@ -84,7 +84,7 @@ impl Config {
             home_path: Filesystem::new(homedir),
             shell: RefCell::new(shell),
             rustc: LazyCell::new(),
-            cwd: cwd,
+            cwd,
             values: LazyCell::new(),
             cargo_exe: LazyCell::new(),
             rustdoc: LazyCell::new(),
index 565b41bb4c736a300db79edf9c2e64f2bdbf620e..e552069d034ba0ed9a8c40c4acc264bb03929ead 100644 (file)
@@ -104,8 +104,8 @@ impl CargoTestError {
                                 .collect::<Vec<String>>()
                                 .join("\n");
         CargoTestError {
-            test: test,
-            desc: desc,
+            test,
+            desc,
             exit: errors[0].exit,
             causes: errors,
         }
@@ -201,7 +201,7 @@ pub fn process_error(msg: &str,
     }
 
     return ProcessError {
-        desc: desc,
+        desc,
         exit: status.cloned(),
         output: output.cloned(),
     };
index 2913d436310a7062138a518de4fda25dd59f34d8..28e7206372a9f4afa052fa47d38e673e7b8b7c37 100644 (file)
@@ -17,7 +17,7 @@ pub struct FileLock {
     state: State,
 }
 
-#[derive(PartialEq)]
+#[derive(PartialEq, Debug)]
 enum State {
     Unlocked,
     Shared,
@@ -35,13 +35,13 @@ impl FileLock {
     /// Note that special care must be taken to ensure that the path is not
     /// referenced outside the lifetime of this lock.
     pub fn path(&self) -> &Path {
-        assert!(self.state != State::Unlocked);
+        assert_ne!(self.state, State::Unlocked);
         &self.path
     }
 
     /// Returns the parent path containing this file
     pub fn parent(&self) -> &Path {
-        assert!(self.state != State::Unlocked);
+        assert_ne!(self.state, State::Unlocked);
         self.path.parent().unwrap()
     }
 
@@ -229,7 +229,7 @@ impl Filesystem {
             State::Unlocked => {}
 
         }
-        Ok(FileLock { f: Some(f), path: path, state: state })
+        Ok(FileLock { f: Some(f), path, state })
     }
 }
 
index 42035e1713fbcb1b0144e18498cf4f6834d671d8..be072a3eb40b46fcdc04f55d7211a4c998f05b66 100644 (file)
@@ -114,7 +114,7 @@ mod imp {
             return None
         }
 
-        Some(Setup { job: job })
+        Some(Setup { job })
     }
 
     impl Drop for Setup {
index 8082369d9d539c0dd94a3627aa8e382a5b122ba5..6a8ceff9cc738ad6a91d8ec6d8fe120c62a8a781 100644 (file)
@@ -244,9 +244,9 @@ impl ProcessBuilder {
                 None)
         })?;
         let output = Output {
-            stdout: stdout,
-            stderr: stderr,
-            status: status,
+            stdout,
+            stderr,
+            status,
         };
 
         {
index 7b2681082968c96d3034bbcad9998d3d6ea0605c..ba8b2b58d46821fd050c6ed0f067568f7fc31a17 100644 (file)
@@ -137,7 +137,7 @@ mod imp {
     impl<'a> Pipe<'a> {
         unsafe fn new<P: IntoRawHandle>(p: P, dst: &'a mut Vec<u8>) -> Pipe<'a> {
             Pipe {
-                dst: dst,
+                dst,
                 pipe: NamedPipe::from_raw_handle(p.into_raw_handle()),
                 overlapped: Overlapped::zero(),
                 done: false,
index a9b65c959ca417d8837dec24c6d844e53604eda9..fdd96748c0c820e515ef13ab10d0954cbf49d622 100644 (file)
@@ -40,10 +40,10 @@ impl Rustc {
         };
 
         Ok(Rustc {
-            path: path,
-            wrapper: wrapper,
-            verbose_version: verbose_version,
-            host: host,
+            path,
+            wrapper,
+            verbose_version,
+            host,
         })
     }
 
index 7fc975a0a7d8284eb2f9e64e42d96272dc454bcb..3e1878853a7a1c0512f687da4d49fce5b45ce6c1 100644 (file)
@@ -301,22 +301,22 @@ impl<'de> de::Deserialize<'de> for U32OrBool {
                 formatter.write_str("a boolean or an integer")
             }
 
-            fn visit_i64<E>(self, u: i64) -> Result<Self::Value, E>
+            fn visit_bool<E>(self, b: bool) -> Result<Self::Value, E>
                 where E: de::Error,
             {
-                Ok(U32OrBool::U32(u as u32))
+                Ok(U32OrBool::Bool(b))
             }
 
-            fn visit_u64<E>(self, u: u64) -> Result<Self::Value, E>
+            fn visit_i64<E>(self, u: i64) -> Result<Self::Value, E>
                 where E: de::Error,
             {
                 Ok(U32OrBool::U32(u as u32))
             }
 
-            fn visit_bool<E>(self, b: bool) -> Result<Self::Value, E>
+            fn visit_u64<E>(self, u: u64) -> Result<Self::Value, E>
                 where E: de::Error,
             {
-                Ok(U32OrBool::Bool(b))
+                Ok(U32OrBool::U32(u as u32))
             }
         }
 
@@ -361,16 +361,16 @@ impl<'de> de::Deserialize<'de> for StringOrBool {
                 formatter.write_str("a boolean or a string")
             }
 
-            fn visit_str<E>(self, s: &str) -> Result<Self::Value, E>
+            fn visit_bool<E>(self, b: bool) -> Result<Self::Value, E>
                 where E: de::Error,
             {
-                Ok(StringOrBool::String(s.to_string()))
+                Ok(StringOrBool::Bool(b))
             }
 
-            fn visit_bool<E>(self, b: bool) -> Result<Self::Value, E>
+            fn visit_str<E>(self, s: &str) -> Result<Self::Value, E>
                 where E: de::Error,
             {
-                Ok(StringOrBool::Bool(b))
+                Ok(StringOrBool::String(s.to_string()))
             }
         }
 
@@ -604,9 +604,9 @@ impl TomlManifest {
             let mut cx = Context {
                 pkgid: Some(&pkgid),
                 deps: &mut deps,
-                source_id: source_id,
+                source_id,
                 nested_paths: &mut nested_paths,
-                config: config,
+                config,
                 warnings: &mut warnings,
                 features: &features,
                 platform: None,
@@ -800,13 +800,13 @@ impl TomlManifest {
             let mut cx = Context {
                 pkgid: None,
                 deps: &mut deps,
-                source_id: source_id,
+                source_id,
                 nested_paths: &mut nested_paths,
-                config: config,
+                config,
                 warnings: &mut warnings,
                 platform: None,
                 features: &features,
-                root: root
+                root
             };
             (me.replace(&mut cx)?, me.patch(&mut cx)?)
         };
@@ -1207,7 +1207,7 @@ fn build_profiles(profiles: &Option<TomlProfiles>) -> Profiles {
                 Some(StringOrBool::String(ref n)) => Lto::Named(n.clone()),
                 None => profile.lto,
             },
-            codegen_units: codegen_units,
+            codegen_units,
             rustc_args: None,
             rustdoc_args: None,
             debuginfo: debug.unwrap_or(profile.debuginfo),
index 19d3e700c605004a6648ecacdf8dcf209e88232f..637fa4303980f7b2b63c009812865db51a31b587 100644 (file)
@@ -103,9 +103,9 @@ impl Registry {
                       token: Option<String>,
                       handle: Easy) -> Registry {
         Registry {
-            host: host,
-            token: token,
-            handle: handle,
+            host,
+            token,
+            handle,
         }
     }
 
@@ -197,8 +197,8 @@ impl Registry {
             .unwrap_or_else(Vec::new);
 
         Ok(Warnings {
-            invalid_categories: invalid_categories,
-            invalid_badges: invalid_badges,
+            invalid_categories,
+            invalid_badges,
         })
     }
 
index 439457c232eb53c627eb8ec161d49b1b4d6f56f3..0fe2db676dccd52a08cd36c49c450fa91dd08f05 100644 (file)
@@ -27,7 +27,7 @@ impl RepoBuilder {
             t!(config.set_str("user.name", "name"));
             t!(config.set_str("user.email", "email"));
         }
-        RepoBuilder { repo: repo, files: Vec::new() }
+        RepoBuilder { repo, files: Vec::new() }
     }
 
     pub fn file(self, path: &str, contents: &str) -> RepoBuilder {
index 099e39d189236e8e60f4807a2f58a6690d8712e3..07e5f6f3ceb72eaec184a7edc3cfe19c0b4eef7d 100644 (file)
@@ -45,7 +45,7 @@ struct FileBuilder {
 
 impl FileBuilder {
     pub fn new(path: PathBuf, body: &str) -> FileBuilder {
-        FileBuilder { path: path, body: body.to_string() }
+        FileBuilder { path, body: body.to_string() }
     }
 
     fn mk(&self) {
@@ -71,7 +71,7 @@ struct SymlinkBuilder {
 
 impl SymlinkBuilder {
     pub fn new(dst: PathBuf, src: PathBuf) -> SymlinkBuilder {
-        SymlinkBuilder { dst: dst, src: src }
+        SymlinkBuilder { dst, src }
     }
 
     #[cfg(unix)]
@@ -699,7 +699,7 @@ fn find_mismatch<'a>(expected: &'a Value, actual: &'a Value)
                 assert!(r.len() > 0);
                 Some((&l[0], &r[0]))
             } else {
-                assert!(r.len() == 0);
+                assert_eq!(r.len(), 0);
                 None
             }
         }
index 8a74fc0f61df9b44c5ad9a809f4f139b2753f131..3358036efef41d24adfe34a4026181e67ea77b04 100644 (file)
@@ -67,7 +67,7 @@ pub trait CargoPathExt {
         self.move_in_time(|sec, nsec| (sec + 3600, nsec))
     }
 
-    fn move_in_time<F>(&self, F)
+    fn move_in_time<F>(&self, travel_amount: F)
         where F: Fn(u64, u32) -> (u64, u32);
 }
 
index 47a6173e4b5a8adb5cb05772bfaacf0587216f8f..6327b7b2cdf665d1ca96079a6e6de9f15f826e19 100644 (file)
@@ -602,7 +602,7 @@ fn git_lock_file_doesnt_change() {
 
     let mut lock2 = String::new();
     t!(t!(File::open(p.root().join("Cargo.lock"))).read_to_string(&mut lock2));
-    assert!(lock1 == lock2, "lock files changed");
+    assert_eq!(lock1, lock2, "lock files changed");
 }
 
 #[test]
index 30b2651bcca65d3c1ec56fe1d775d0ae081f1daa..efd0c6124eca20d932cb7a0517ec94160fee4479 100644 (file)
@@ -42,7 +42,7 @@ fn adding_and_removing_packages() {
     assert_that(p.cargo("generate-lockfile"),
                 execs().with_status(0));
     let lock2 = p.read_lockfile();
-    assert!(lock1 != lock2);
+    assert_ne!(lock1, lock2);
 
     // change the dep
     File::create(&p.root().join("bar/Cargo.toml")).unwrap().write_all(br#"
@@ -54,8 +54,8 @@ fn adding_and_removing_packages() {
     assert_that(p.cargo("generate-lockfile"),
                 execs().with_status(0));
     let lock3 = p.read_lockfile();
-    assert!(lock1 != lock3);
-    assert!(lock2 != lock3);
+    assert_ne!(lock1, lock3);
+    assert_ne!(lock2, lock3);
 
     // remove the dep
     println!("lock4");
index c3da7daa0905147ed750b61ffe5847472ed1a104..edb1dc627005dae5b5671bc8da8425d678795921 100644 (file)
@@ -901,7 +901,7 @@ fn use_path_workspace() {
     let lock = p.read_lockfile();
     assert_that(p.cargo("install"), execs().with_status(0));
     let lock2 = p.read_lockfile();
-    assert!(lock == lock2, "different lockfiles");
+    assert_eq!(lock, lock2, "different lockfiles");
 }
 
 #[test]
index 47ca003206f142f2a16e7b16649dab9b171a3bf0..8a0d754d934d977928299c3ba027efdcdfcae6c3 100644 (file)
@@ -681,7 +681,7 @@ fn remove_patch() {
 
     assert!(lock_file1.contains("bar"));
     assert_eq!(lock_file2, lock_file3);
-    assert!(lock_file1 != lock_file2);
+    assert_ne!(lock_file1, lock_file2);
 }
 
 #[test]