Skip to content

Commit

Permalink
Fix clippy warnings in build.rs and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kngwyu committed Feb 10, 2020
1 parent 3176097 commit a1070ff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,14 @@ fn get_config_vars(python_path: &str) -> Result<HashMap<String, String>, String>
));
}
let all_vars = SYSCONFIG_FLAGS.iter().chain(SYSCONFIG_VALUES.iter());
let all_vars = all_vars.zip(split_stdout.iter()).fold(
HashMap::new(),
|mut memo: HashMap<String, String>, (&k, &v)| {
if !(v.to_owned() == "None" && is_value(k)) {
memo.insert(k.to_owned(), v.to_owned());
let all_vars = all_vars
.zip(split_stdout.iter())
.fold(HashMap::new(), |mut memo, (&k, &v)| {
if !(v == "None" && is_value(k)) {
memo.insert(k.to_string(), v.to_string());
}
memo
},
);
});

Ok(fix_config_map(all_vars))
}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pyself.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl PyIterProtocol for Iter {
fn reader() -> Reader {
let reader = [(1, "a"), (2, "b"), (3, "c"), (4, "d"), (5, "e")];
Reader {
inner: reader.iter().map(|(k, v)| (*k, v.to_string())).collect(),
inner: reader.iter().map(|(k, v)| (*k, (*v).to_string())).collect(),
}
}

Expand Down

0 comments on commit a1070ff

Please sign in to comment.