Skip to content

Commit 6a2d62f

Browse files
committed
Auto merge of #8146 - hbina:fix_borrow_and_clone, r=ehuss
Fixed some unnecessary borrows and clones. As suggested by the clippy.
2 parents 11f329d + 686ccfa commit 6a2d62f

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

src/cargo/core/compiler/context/compilation_files.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
133133
.map(|unit| (unit, LazyCell::new()))
134134
.collect();
135135
CompilationFiles {
136-
ws: &cx.bcx.ws,
136+
ws: cx.bcx.ws,
137137
host,
138138
target,
139139
export_dir: cx.bcx.build_config.export_dir.clone(),

src/cargo/core/manifest.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ compact_debug! {
353353
kinds.clone(),
354354
self.src_path.path().unwrap().to_path_buf(),
355355
self.edition,
356-
).inner.clone(),
356+
).inner,
357357
format!("lib_target({:?}, {:?}, {:?}, {:?})",
358358
self.name, kinds, self.src_path, self.edition),
359359
)
@@ -366,21 +366,21 @@ compact_debug! {
366366
&self.name,
367367
path.to_path_buf(),
368368
self.edition,
369-
).inner.clone(),
369+
).inner,
370370
format!("custom_build_target({:?}, {:?}, {:?})",
371371
self.name, path, self.edition),
372372
)
373373
}
374374
TargetSourcePath::Metabuild => {
375375
(
376-
Target::metabuild_target(&self.name).inner.clone(),
376+
Target::metabuild_target(&self.name).inner,
377377
format!("metabuild_target({:?})", self.name),
378378
)
379379
}
380380
}
381381
}
382382
_ => (
383-
Target::new(self.src_path.clone(), self.edition).inner.clone(),
383+
Target::new(self.src_path.clone(), self.edition).inner,
384384
format!("with_path({:?}, {:?})", self.src_path, self.edition),
385385
),
386386
}

src/cargo/ops/cargo_compile.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ pub fn create_bcx<'a, 'cfg>(
419419
&resolved_features,
420420
&pkg_set,
421421
&profiles,
422-
&interner,
422+
interner,
423423
)?;
424424

425425
let std_roots = if let Some(crates) = &config.cli_unstable().build_std {
@@ -442,7 +442,7 @@ pub fn create_bcx<'a, 'cfg>(
442442
std_features,
443443
build_config.requested_kind,
444444
&pkg_set,
445-
&interner,
445+
interner,
446446
&profiles,
447447
)?
448448
} else {
@@ -491,7 +491,7 @@ pub fn create_bcx<'a, 'cfg>(
491491
build_config.mode,
492492
&target_data,
493493
&profiles,
494-
&interner,
494+
interner,
495495
)?;
496496

497497
let bcx = BuildContext::new(

src/cargo/ops/registry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ fn get_source_id(
811811
reg: Option<&String>,
812812
) -> CargoResult<SourceId> {
813813
match (reg, index) {
814-
(Some(r), _) => SourceId::alt_registry(config, &r),
814+
(Some(r), _) => SourceId::alt_registry(config, r),
815815
(_, Some(i)) => SourceId::for_registry(&i.into_url()?),
816816
_ => {
817817
let map = SourceConfigMap::new(config)?;

src/cargo/ops/resolve.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ pub fn resolve_ws_with_opts<'cfg>(
127127
let pkg_set = get_resolved_packages(&resolved_with_overrides, registry)?;
128128

129129
let member_ids = ws
130-
.members_with_features(&specs, &opts.features)?
130+
.members_with_features(specs, &opts.features)?
131131
.into_iter()
132132
.map(|(p, _fts)| p.package_id())
133133
.collect::<Vec<_>>();
@@ -136,7 +136,7 @@ pub fn resolve_ws_with_opts<'cfg>(
136136
&member_ids,
137137
has_dev_units,
138138
requested_target,
139-
&target_data,
139+
target_data,
140140
)?;
141141

142142
let resolved_features = FeatureResolver::resolve(

0 commit comments

Comments
 (0)