Fixing 1.47 complaints from clippy.

needless_collect seems to be off because removing them
*will* cause some borrow checker complaints. We might be able
to correct those better, but probably not everywhere.
This commit is contained in:
Nicolas Patry
2020-10-09 18:28:50 +02:00
parent dd9fda5d05
commit 35feff0042
2 changed files with 2 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
#![warn(clippy::all)]
#![allow(clippy::needless_collect)]
#![doc(html_favicon_url = "https://huggingface.co/favicon.ico")]
#![doc(html_logo_url = "https://huggingface.co/landing/assets/huggingface_logo.svg")]

View File

@@ -26,10 +26,7 @@ pub fn get_parallelism() -> bool {
match std::env::var(ENV_VARIABLE) {
Ok(mut v) => {
v.make_ascii_lowercase();
match v.as_ref() {
"" | "off" | "false" | "f" | "no" | "n" | "0" => false,
_ => true,
}
!matches!(v.as_ref(), "" | "off" | "false" | "f" | "no" | "n" | "0")
}
Err(_) => true, // If we couldn't get the variable, we use the default
}