chore(lint): fix clippy warnings

This commit is contained in:
LynithDev 2026-07-25 20:21:27 +02:00
parent 57408aa710
commit 34742efc78
3 changed files with 7 additions and 11 deletions

View file

@ -89,6 +89,7 @@ pub async fn download_to_path(
}
#[tracing::instrument(skip(requester, notifier, progress, label), fields(%url), level = "debug")]
#[allow(clippy::too_many_arguments)]
pub async fn fetch_bytes_verified(
requester: &RequestClient,
notifier: &NotificationService,

View file

@ -45,9 +45,7 @@ pub async fn check_java_runtime(absolute_path: String) -> JavaResult<JavaCheckIn
let info = java_info
.lines()
.filter_map(|line| {
let mut parts = line.splitn(2, '=');
let key = parts.next()?;
let value = parts.next()?;
let (key, value) = line.split_once('=')?;
Some((key.to_string(), value.to_string()))
})

View file

@ -113,9 +113,9 @@ fn resolve_installed_executable(extract_root: &Path, package: &JavaPackage) -> P
{
use crate::java::vendors::JavaVendor;
if !base_path.join("Contents").join("Home").exists() {
if let Ok(mut entries) = std::fs::read_dir(&base_path) {
if let Some(dir) = entries.flatten().find(|entry| {
if !base_path.join("Contents").join("Home").exists()
&& let Ok(entries) = std::fs::read_dir(&base_path)
&& let Some(dir) = entries.flatten().find(|entry| {
let file_name = entry.file_name();
let name = file_name.to_string_lossy();
(name.ends_with(".jre") || name.ends_with(".jdk") || name.contains("zulu"))
@ -123,17 +123,14 @@ fn resolve_installed_executable(extract_root: &Path, package: &JavaPackage) -> P
}) {
base_path = dir.path();
}
}
}
if package.vendor == JavaVendor::Zulu {
if let Some(major) = package.java_version.first() {
if package.vendor == JavaVendor::Zulu
&& let Some(major) = package.java_version.first() {
let zulu_bundle = base_path.join(format!("zulu-{major}.jre"));
if zulu_bundle.join("Contents").join("Home").exists() {
base_path = zulu_bundle;
}
}
}
base_path.join(java_executable_relative_path())
}