Skip to content

Commit

Permalink
Auto merge of rust-lang#8146 - hbina:fix_borrow_and_clone, r=ehuss
Browse files Browse the repository at this point in the history
Fixed some unnecessary borrows and clones.

As suggested by the clippy.
  • Loading branch information
bors committed Apr 26, 2020
2 parents 11f329d + 686ccfa commit 6a2d62f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/cargo/core/compiler/context/compilation_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
.map(|unit| (unit, LazyCell::new()))
.collect();
CompilationFiles {
ws: &cx.bcx.ws,
ws: cx.bcx.ws,
host,
target,
export_dir: cx.bcx.build_config.export_dir.clone(),
Expand Down
8 changes: 4 additions & 4 deletions src/cargo/core/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ compact_debug! {
kinds.clone(),
self.src_path.path().unwrap().to_path_buf(),
self.edition,
).inner.clone(),
).inner,
format!("lib_target({:?}, {:?}, {:?}, {:?})",
self.name, kinds, self.src_path, self.edition),
)
Expand All @@ -366,21 +366,21 @@ compact_debug! {
&self.name,
path.to_path_buf(),
self.edition,
).inner.clone(),
).inner,
format!("custom_build_target({:?}, {:?}, {:?})",
self.name, path, self.edition),
)
}
TargetSourcePath::Metabuild => {
(
Target::metabuild_target(&self.name).inner.clone(),
Target::metabuild_target(&self.name).inner,
format!("metabuild_target({:?})", self.name),
)
}
}
}
_ => (
Target::new(self.src_path.clone(), self.edition).inner.clone(),
Target::new(self.src_path.clone(), self.edition).inner,
format!("with_path({:?}, {:?})", self.src_path, self.edition),
),
}
Expand Down
6 changes: 3 additions & 3 deletions src/cargo/ops/cargo_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ pub fn create_bcx<'a, 'cfg>(
&resolved_features,
&pkg_set,
&profiles,
&interner,
interner,
)?;

let std_roots = if let Some(crates) = &config.cli_unstable().build_std {
Expand All @@ -442,7 +442,7 @@ pub fn create_bcx<'a, 'cfg>(
std_features,
build_config.requested_kind,
&pkg_set,
&interner,
interner,
&profiles,
)?
} else {
Expand Down Expand Up @@ -491,7 +491,7 @@ pub fn create_bcx<'a, 'cfg>(
build_config.mode,
&target_data,
&profiles,
&interner,
interner,
)?;

let bcx = BuildContext::new(
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/ops/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ fn get_source_id(
reg: Option<&String>,
) -> CargoResult<SourceId> {
match (reg, index) {
(Some(r), _) => SourceId::alt_registry(config, &r),
(Some(r), _) => SourceId::alt_registry(config, r),
(_, Some(i)) => SourceId::for_registry(&i.into_url()?),
_ => {
let map = SourceConfigMap::new(config)?;
Expand Down
4 changes: 2 additions & 2 deletions src/cargo/ops/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ pub fn resolve_ws_with_opts<'cfg>(
let pkg_set = get_resolved_packages(&resolved_with_overrides, registry)?;

let member_ids = ws
.members_with_features(&specs, &opts.features)?
.members_with_features(specs, &opts.features)?
.into_iter()
.map(|(p, _fts)| p.package_id())
.collect::<Vec<_>>();
Expand All @@ -136,7 +136,7 @@ pub fn resolve_ws_with_opts<'cfg>(
&member_ids,
has_dev_units,
requested_target,
&target_data,
target_data,
)?;

let resolved_features = FeatureResolver::resolve(
Expand Down

0 comments on commit 6a2d62f

Please sign in to comment.