Fix clippy issues

This commit is contained in:
Jai A
2023-03-30 15:18:57 -07:00
parent 80e1ae4553
commit 4875ed4359
16 changed files with 114 additions and 87 deletions

View File

@@ -57,7 +57,7 @@ pub async fn fetch_mirrors(
let _permits = sem.acquire_many(permits).await.unwrap();
let sem = Arc::new(Semaphore::new(permits.try_into().unwrap()));
future::select_ok(urls.into_iter().map(|url| {
future::select_ok(urls.iter().map(|url| {
let sha1 = sha1.map(String::from);
let url = String::from(*url);
let sem = Arc::clone(&sem);

View File

@@ -185,11 +185,11 @@ pub fn get_all_jre_path() -> Result<HashSet<JavaVersion>, JREError> {
#[cfg(target_os = "windows")]
#[allow(dead_code)]
const JAVA_BIN: &'static str = "java.exe";
const JAVA_BIN: &str = "java.exe";
#[cfg(not(target_os = "windows"))]
#[allow(dead_code)]
const JAVA_BIN: &'static str = "java";
const JAVA_BIN: &str = "java";
// For example filepath 'path', attempt to resolve it and get a Java version at this path
// If no such path exists, or no such valid java at this path exists, returns None

View File

@@ -31,11 +31,7 @@ pub fn os_rule(rule: &OsRule) -> bool {
let mut rule_match = true;
if let Some(ref arch) = rule.arch {
rule_match &= match arch.as_str() {
"x86" => cfg!(any(target_arch = "x86", target_arch = "x86_64")),
"arm" => cfg!(target_arch = "arm"),
_ => true,
};
rule_match &= !matches!(arch.as_str(), "x86" | "arm");
}
if let Some(name) = &rule.name {