fix: formatting

This commit is contained in:
objz committed 2026-07-11 15:46:15 +02:00
1 parent 6f5722aa02
commit b94957a952
6 files changed
+87 -54

No files matched your search

+10 -7
View File
@@ -462,13 +462,16 @@ fn quadrant_cell(pixels: [[u8; 3]; 4]) -> IconCell {
let bg = pixels[pair.0];
let fg = pixels[pair.1];
let mask = pixels.iter().enumerate().fold(0_u8, |mask, (index, pixel)| {
if color_distance(*pixel, fg) <= color_distance(*pixel, bg) {
mask | (1 << index)
} else {
mask
}
});
let mask = pixels
.iter()
.enumerate()
.fold(0_u8, |mask, (index, pixel)| {
if color_distance(*pixel, fg) <= color_distance(*pixel, bg) {
mask | (1 << index)
} else {
mask
}
});
let symbol = match mask {
0 => ' ',
1 => '\u{2598}',
+16 -14
View File
@@ -145,13 +145,14 @@ async fn download_mod_files(
let completed = completed.clone();
tasks.spawn(async move {
if let Some(parent) = dest.parent()
&& let Err(e) = tokio::fs::create_dir_all(parent).await {
tracing::warn!(
"Failed to create mod download directory {}: {}",
parent.display(),
e
);
}
&& let Err(e) = tokio::fs::create_dir_all(parent).await
{
tracing::warn!(
"Failed to create mod download directory {}: {}",
parent.display(),
e
);
}
progress::set_sub_action(filename);
tracing::trace!("Downloading .mrpack file to {}", dest.display());
crate::net::download_file(&client, &url, &dest, |_, _| {}).await?;
@@ -183,13 +184,14 @@ async fn download_mod_files(
let completed = completed.clone();
tasks.spawn(async move {
if let Some(parent) = dest.parent()
&& let Err(e) = tokio::fs::create_dir_all(parent).await {
tracing::warn!(
"Failed to create mod download directory {}: {}",
parent.display(),
e
);
}
&& let Err(e) = tokio::fs::create_dir_all(parent).await
{
tracing::warn!(
"Failed to create mod download directory {}: {}",
parent.display(),
e
);
}
progress::set_sub_action(filename);
tracing::trace!("Downloading .mrpack file to {}", dest.display());
crate::net::download_file(&client, &url, &dest, |_, _| {}).await?;
+7 -7
View File
@@ -28,17 +28,13 @@ pub enum LaunchError {
Json(#[from] serde_json::Error),
#[error("{0} launch is not yet supported")]
NotSupported(String),
#[error(
"This instance requires Java {required}, but rmcl is using Java {detected}: {java}"
)]
#[error("This instance requires Java {required}, but rmcl is using Java {detected}: {java}")]
JavaTooOld {
java: String,
required: u32,
detected: u32,
},
#[error(
"This instance requires Java {required}, but rmcl could not check {java}: {reason}"
)]
#[error("This instance requires Java {required}, but rmcl could not check {java}: {reason}")]
JavaCheckFailed {
java: String,
required: u32,
@@ -414,7 +410,11 @@ pub async fn build_launch_invocation(
// so we check there first.
let has_local_libs = matches!(config.loader, ModLoader::Forge | ModLoader::NeoForge);
let local_lib_dir = minecraft_dir.join("libraries");
let library_directory = if has_local_libs { &local_lib_dir } else { &lib_dir };
let library_directory = if has_local_libs {
&local_lib_dir
} else {
&lib_dir
};
let mut classpath: Vec<PathBuf> = Vec::new();
for lib in &merged_profile.libraries {
+3 -1
View File
@@ -254,7 +254,9 @@ impl InstanceManager {
.await
.map_err(|e| match e {
InstallError::Download(net_error) => InstanceError::Download(net_error),
InstallError::Installer(installer_error) => InstanceError::InstallerError(installer_error),
InstallError::Installer(installer_error) => {
InstanceError::InstallerError(installer_error)
}
})?;
let config = InstanceConfig {