From a1070ff58205be43a57b3416f53899a4d205bcee Mon Sep 17 00:00:00 2001 From: kngwyu Date: Mon, 10 Feb 2020 11:20:18 +0900 Subject: [PATCH] Fix clippy warnings in build.rs and tests --- build.rs | 13 ++++++------- tests/test_pyself.rs | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/build.rs b/build.rs index 0ddd1374871..2195b7f1ef4 100644 --- a/build.rs +++ b/build.rs @@ -236,15 +236,14 @@ fn get_config_vars(python_path: &str) -> Result, 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, (&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)) } diff --git a/tests/test_pyself.rs b/tests/test_pyself.rs index 00eebfb128f..ae7ce01f448 100644 --- a/tests/test_pyself.rs +++ b/tests/test_pyself.rs @@ -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(), } }