Skip to content

Commit

Permalink
Auto merge of #10081 - hi-rustin:rustin-patch-clippy, r=ehuss
Browse files Browse the repository at this point in the history
Remove needless borrow to make clippy happy

Make clippy happy.
  • Loading branch information
bors committed Nov 14, 2021
2 parents 458d345 + e83704a commit 3a3a071
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/cargo/core/compiler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ fn rustdoc(cx: &mut Context<'_, '_>, unit: &Unit) -> CargoResult<Work> {
rustdoc.args(args);
}

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

let scrape_output_path = |unit: &Unit| -> CargoResult<PathBuf> {
Expand Down
6 changes: 3 additions & 3 deletions src/cargo/core/compiler/unit_dependencies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ fn calc_deps_of_std(
// Compute dependencies for the standard library.
state.is_std = true;
for roots in std_roots.values() {
deps_of_roots(roots, &mut state)?;
deps_of_roots(roots, state)?;
}
state.is_std = false;
Ok(Some(std::mem::take(&mut state.unit_dependencies)))
Expand Down Expand Up @@ -172,7 +172,7 @@ fn attach_std_deps(

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

Ok(())
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/util/toml/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,7 @@ impl TomlManifest {
for (name, platform) in me.target.iter().flatten() {
cx.platform = {
let platform: Platform = name.parse()?;
platform.check_cfg_attributes(&mut cx.warnings);
platform.check_cfg_attributes(cx.warnings);
Some(platform)
};
process_dependencies(&mut cx, platform.dependencies.as_ref(), None)?;
Expand Down

0 comments on commit 3a3a071

Please sign in to comment.