Skip to content

Commit 3a3a071

Browse files
committed
Auto merge of #10081 - hi-rustin:rustin-patch-clippy, r=ehuss
Remove needless borrow to make clippy happy Make clippy happy.
2 parents 458d345 + e83704a commit 3a3a071

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/cargo/core/compiler/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ fn rustdoc(cx: &mut Context<'_, '_>, unit: &Unit) -> CargoResult<Work> {
648648
rustdoc.args(args);
649649
}
650650

651-
let metadata = cx.metadata_for_doc_units[&unit];
651+
let metadata = cx.metadata_for_doc_units[unit];
652652
rustdoc.arg("-C").arg(format!("metadata={}", metadata));
653653

654654
let scrape_output_path = |unit: &Unit| -> CargoResult<PathBuf> {

src/cargo/core/compiler/unit_dependencies.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ fn calc_deps_of_std(
132132
// Compute dependencies for the standard library.
133133
state.is_std = true;
134134
for roots in std_roots.values() {
135-
deps_of_roots(roots, &mut state)?;
135+
deps_of_roots(roots, state)?;
136136
}
137137
state.is_std = false;
138138
Ok(Some(std::mem::take(&mut state.unit_dependencies)))
@@ -172,7 +172,7 @@ fn attach_std_deps(
172172

173173
/// Compute all the dependencies of the given root units.
174174
/// The result is stored in state.unit_dependencies.
175-
fn deps_of_roots(roots: &[Unit], mut state: &mut State<'_, '_>) -> CargoResult<()> {
175+
fn deps_of_roots(roots: &[Unit], state: &mut State<'_, '_>) -> CargoResult<()> {
176176
for unit in roots.iter() {
177177
// Dependencies of tests/benches should not have `panic` set.
178178
// We check the global test mode to see if we are running in `cargo
@@ -200,7 +200,7 @@ fn deps_of_roots(roots: &[Unit], mut state: &mut State<'_, '_>) -> CargoResult<(
200200
} else {
201201
UnitFor::new_normal()
202202
};
203-
deps_of(unit, &mut state, unit_for)?;
203+
deps_of(unit, state, unit_for)?;
204204
}
205205

206206
Ok(())

src/cargo/util/toml/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1248,7 +1248,7 @@ impl TomlManifest {
12481248
for (name, platform) in me.target.iter().flatten() {
12491249
cx.platform = {
12501250
let platform: Platform = name.parse()?;
1251-
platform.check_cfg_attributes(&mut cx.warnings);
1251+
platform.check_cfg_attributes(cx.warnings);
12521252
Some(platform)
12531253
};
12541254
process_dependencies(&mut cx, platform.dependencies.as_ref(), None)?;

0 commit comments

Comments
 (0)