Skip to content

Commit

Permalink
Remove needless borrow to make clippy happy
Browse files Browse the repository at this point in the history
Signed-off-by: hi-rustin <[email protected]>
  • Loading branch information
Rustin170506 committed Nov 14, 2021
1 parent 458d345 commit e83704a
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 e83704a

Please sign in to comment.