Skip to content

Commit 7059559

Browse files
committed
Auto merge of #7771 - moxian:needless-borrow, r=alexcrichton
Fix several needless_borrow clippy lints. Fixes several [needless_borrow](https://rust-lang.github.io/rust-clippy/v0.0.212/index.html#needless_borrow) clippy lints. I've only fixed this kind of lint errors and not others, since for some reason these are the only ones that show as red squigglies in my editor of choice.
2 parents 25eb5cd + 239ebf4 commit 7059559

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/bin/cargo/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Run with 'cargo -Z [FLAG] [SUBCOMMAND]'"
102102
}
103103
};
104104
config_configure(config, &args, subcommand_args)?;
105-
super::init_git_transports(&config);
105+
super::init_git_transports(config);
106106

107107
execute_subcommand(config, cmd, subcommand_args)
108108
}

src/cargo/core/compiler/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@ pub fn extern_args<'a>(
10081008

10091009
for dep in deps {
10101010
if dep.unit.target.linkable() && !dep.unit.mode.is_doc() {
1011-
link_to(&dep, dep.extern_crate_name, dep.noprelude)?;
1011+
link_to(dep, dep.extern_crate_name, dep.noprelude)?;
10121012
}
10131013
}
10141014
if unit.target.proc_macro()

src/cargo/util/config/de.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,11 @@ impl<'de, 'config> de::MapAccess<'de> for ConfigMapAccess<'config> {
291291
// Set this as the current key in the deserializer.
292292
let field = match field {
293293
KeyKind::Normal(field) => {
294-
self.de.key.push(&field);
294+
self.de.key.push(field);
295295
field
296296
}
297297
KeyKind::CaseSensitive(field) => {
298-
self.de.key.push_sensitive(&field);
298+
self.de.key.push_sensitive(field);
299299
field
300300
}
301301
};

src/cargo/util/config/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ impl Config {
832832
for arg in cli_args {
833833
// TODO: This should probably use a more narrow parser, reject
834834
// comments, blank lines, [headers], etc.
835-
let toml_v: toml::Value = toml::de::from_str(&arg)
835+
let toml_v: toml::Value = toml::de::from_str(arg)
836836
.chain_err(|| format!("failed to parse --config argument `{}`", arg))?;
837837
let toml_table = toml_v.as_table().unwrap();
838838
if toml_table.len() != 1 {

src/cargo/util/config/target.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ fn parse_links_overrides(
113113
"rustc-flags" => {
114114
let flags = value.string(key)?;
115115
let whence = format!("target config `{}.{}` (in {})", target_key, key, flags.1);
116-
let (paths, links) = BuildOutput::parse_rustc_flags(&flags.0, &whence)?;
116+
let (paths, links) = BuildOutput::parse_rustc_flags(flags.0, &whence)?;
117117
output.library_paths.extend(paths);
118118
output.library_links.extend(links);
119119
}

0 commit comments

Comments
 (0)