Skip to content

Commit 8153d6e

Browse files
authored
Merge pull request #147 from rust-lang/clippy-warnings
Fix a couple of clippy warnings
2 parents a305d77 + 902d5ca commit 8153d6e

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ A library to run the pkg-config system tool at build time in order to be used in
1212
Cargo build scripts.
1313
"""
1414
keywords = ["build-dependencies"]
15+
rust-version = "1.30"
1516

1617
[dev-dependencies]
1718
lazy_static = "1"

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ impl Config {
446446
match (env::var("TARGET"), env::var("HOST")) {
447447
(Ok(target), Ok(host)) => {
448448
let kind = if host == target { "HOST" } else { "TARGET" };
449-
let target_u = target.replace("-", "_");
449+
let target_u = target.replace('-', "_");
450450

451451
self.env_var_os(&format!("{}_{}", var_base, target))
452452
.or_else(|| self.env_var_os(&format!("{}_{}", var_base, target_u)))
@@ -802,8 +802,8 @@ impl Library {
802802
}
803803
}
804804

805-
let mut linker_options = words.iter().filter(|arg| arg.starts_with("-Wl,"));
806-
while let Some(option) = linker_options.next() {
805+
let linker_options = words.iter().filter(|arg| arg.starts_with("-Wl,"));
806+
for option in linker_options {
807807
let mut pop = false;
808808
let mut ld_option = vec![];
809809
for subopt in option[4..].split(',') {
@@ -829,7 +829,7 @@ impl Library {
829829
}
830830

831831
fn parse_modversion(&mut self, output: &str) {
832-
self.version.push_str(output.lines().nth(0).unwrap().trim());
832+
self.version.push_str(output.lines().next().unwrap().trim());
833833
}
834834
}
835835

tests/test.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ fn reset() {
2424
}
2525
env::remove_var("TARGET");
2626
env::remove_var("HOST");
27-
env::set_var(
28-
"PKG_CONFIG_PATH",
29-
&env::current_dir().unwrap().join("tests"),
30-
);
27+
env::set_var("PKG_CONFIG_PATH", env::current_dir().unwrap().join("tests"));
3128
}
3229

3330
fn find(name: &str) -> Result<pkg_config::Library, Error> {

0 commit comments

Comments
 (0)