Skip to content

Commit

Permalink
Merge pull request #147 from rust-lang/clippy-warnings
Browse files Browse the repository at this point in the history
Fix a couple of clippy warnings
  • Loading branch information
sdroege committed May 3, 2023
2 parents a305d77 + 902d5ca commit 8153d6e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Expand Up @@ -12,6 +12,7 @@ A library to run the pkg-config system tool at build time in order to be used in
Cargo build scripts.
"""
keywords = ["build-dependencies"]
rust-version = "1.30"

[dev-dependencies]
lazy_static = "1"
8 changes: 4 additions & 4 deletions src/lib.rs
Expand Up @@ -446,7 +446,7 @@ impl Config {
match (env::var("TARGET"), env::var("HOST")) {
(Ok(target), Ok(host)) => {
let kind = if host == target { "HOST" } else { "TARGET" };
let target_u = target.replace("-", "_");
let target_u = target.replace('-', "_");

self.env_var_os(&format!("{}_{}", var_base, target))
.or_else(|| self.env_var_os(&format!("{}_{}", var_base, target_u)))
Expand Down Expand Up @@ -802,8 +802,8 @@ impl Library {
}
}

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

fn parse_modversion(&mut self, output: &str) {
self.version.push_str(output.lines().nth(0).unwrap().trim());
self.version.push_str(output.lines().next().unwrap().trim());
}
}

Expand Down
5 changes: 1 addition & 4 deletions tests/test.rs
Expand Up @@ -24,10 +24,7 @@ fn reset() {
}
env::remove_var("TARGET");
env::remove_var("HOST");
env::set_var(
"PKG_CONFIG_PATH",
&env::current_dir().unwrap().join("tests"),
);
env::set_var("PKG_CONFIG_PATH", env::current_dir().unwrap().join("tests"));
}

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

0 comments on commit 8153d6e

Please sign in to comment.