From 112b3303a0b1d9b92b42e20b78f34ad1ee027b63 Mon Sep 17 00:00:00 2001 From: Pauline Date: Sat, 17 Aug 2024 17:36:40 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feature:=20normalize=20specta=20fea?= =?UTF-8?q?ture=20flag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pauline --- apps/desktop/Cargo.toml | 2 +- apps/desktop/src/api/commands/processor.rs | 4 ++- .../core/src/api/cluster/content/logger.rs | 14 +++++++--- packages/core/src/api/package/content/mod.rs | 5 ++-- packages/core/src/api/package/import/mod.rs | 2 +- packages/core/src/api/processor.rs | 26 +++++++++++++++---- packages/core/src/api/proxy/mod.rs | 18 ++++++++----- packages/core/src/api/proxy/send.rs | 12 ++------- packages/core/src/game/mod.rs | 2 +- packages/core/src/store/clusters.rs | 16 ++++++------ packages/core/src/store/discord.rs | 4 +-- packages/core/src/store/java_versions.rs | 2 +- packages/core/src/store/minecraft.rs | 4 +-- packages/core/src/store/package.rs | 22 ++++++++-------- packages/core/src/store/processor.rs | 22 ++++++++++++---- packages/core/src/store/settings.rs | 10 +++---- packages/core/src/utils/java.rs | 2 +- 17 files changed, 100 insertions(+), 67 deletions(-) diff --git a/apps/desktop/Cargo.toml b/apps/desktop/Cargo.toml index 6771c820..78f08eb0 100644 --- a/apps/desktop/Cargo.toml +++ b/apps/desktop/Cargo.toml @@ -19,7 +19,7 @@ crate-type = [ "staticlib", "cdylib", "lib" ] tauri-build = { workspace = true, features = [ "isolation" ] } [dependencies] -onelauncher = { workspace = true, features = [ "tauri" ] } +onelauncher = { workspace = true, features = [ "tauri", "specta" ] } onelauncher_macros = { workspace = true } tauri-plugin-shell = { workspace = true } tauri-plugin-window-state = { workspace = true } diff --git a/apps/desktop/src/api/commands/processor.rs b/apps/desktop/src/api/commands/processor.rs index e1017118..e37eab82 100644 --- a/apps/desktop/src/api/commands/processor.rs +++ b/apps/desktop/src/api/commands/processor.rs @@ -23,7 +23,9 @@ pub async fn get_processes_by_path(path: ClusterPath) -> Result, Strin #[specta::specta] #[tauri::command] -pub async fn get_processes_detailed_by_path(path: ClusterPath) -> Result, String> { +pub async fn get_processes_detailed_by_path( + path: ClusterPath, +) -> Result, String> { Ok(processor::get_processes_detailed_by_path(path).await?) } diff --git a/packages/core/src/api/cluster/content/logger.rs b/packages/core/src/api/cluster/content/logger.rs index 4189d192..10eeed61 100644 --- a/packages/core/src/api/cluster/content/logger.rs +++ b/packages/core/src/api/cluster/content/logger.rs @@ -238,18 +238,26 @@ pub async fn delete_logs_by_file( pub async fn read_log_to_string(path: &std::path::PathBuf) -> crate::Result { if let Some(ext) = path.extension() { - let mut file = std::fs::File::open(&path).map_err(|e| IOError::with_path(e, &path))?; + let mut file = std::fs::File::open(path).map_err(|e| IOError::with_path(e, path))?; let mut contents = [0; 1024]; let mut result = String::new(); if ext == "gz" { let mut gz = flate2::read::GzDecoder::new(std::io::BufReader::new(file)); - while gz.read(&mut contents).map_err(|e| IOError::with_path(e, &path))? > 0 { + while gz + .read(&mut contents) + .map_err(|e| IOError::with_path(e, path))? + > 0 + { result.push_str(&String::from_utf8_lossy(&contents)); contents = [0; 1024]; } } else if ext == "log" || ext == "txt" { - while file.read(&mut contents).map_err(|e| IOError::with_path(e, &path))? > 0 { + while file + .read(&mut contents) + .map_err(|e| IOError::with_path(e, path))? + > 0 + { result.push_str(&String::from_utf8_lossy(&contents)); contents = [0; 1024]; } diff --git a/packages/core/src/api/package/content/mod.rs b/packages/core/src/api/package/content/mod.rs index 8950dbcd..c58671a0 100644 --- a/packages/core/src/api/package/content/mod.rs +++ b/packages/core/src/api/package/content/mod.rs @@ -11,7 +11,7 @@ use crate::Result; mod modrinth; /// Providers for content packages -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)] pub enum Providers { // Curseforge, @@ -84,8 +84,7 @@ impl Providers { Ok(versions .into_iter() .find(|v| v.game_versions.contains(&game_version.to_string())) - .ok_or(anyhow!("no game version found"))? - ) // TODO: error handling + .ok_or(anyhow!("no game version found"))?) // TODO: error handling } // pub async fn search(&self, query: &str) -> Result> { diff --git a/packages/core/src/api/package/import/mod.rs b/packages/core/src/api/package/import/mod.rs index 1fabaf11..febe79fd 100644 --- a/packages/core/src/api/package/import/mod.rs +++ b/packages/core/src/api/package/import/mod.rs @@ -21,7 +21,7 @@ pub mod technic; pub mod tlauncher; /// List of launcher types we support importing from. -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)] pub enum ImportType { /// MultiMC based launchers diff --git a/packages/core/src/api/processor.rs b/packages/core/src/api/processor.rs index 3f731492..ee1b759c 100644 --- a/packages/core/src/api/processor.rs +++ b/packages/core/src/api/processor.rs @@ -31,9 +31,16 @@ pub async fn get_process_detailed_by_id(uuid: Uuid) -> crate::Result crate::Result crate::Result> { +pub async fn get_processes_detailed_by_path( + path: ClusterPath, +) -> crate::Result> { let state = State::get().await?; let processor = state.processor.read().await; let uuids = processor.running_cluster(path).await?; let mut processes = Vec::new(); for uuid in uuids { - let child = processor.get(uuid).ok_or(anyhow::anyhow!("process not found"))?; + let child = processor + .get(uuid) + .ok_or(anyhow::anyhow!("process not found"))?; let child = child.read().await; - let pid = child.current_child.read().await.id().ok_or(anyhow::anyhow!("process not found"))?; + let pid = child + .current_child + .read() + .await + .id() + .ok_or(anyhow::anyhow!("process not found"))?; processes.push(DetailedProcess { uuid, user: child.user, diff --git a/packages/core/src/api/proxy/mod.rs b/packages/core/src/api/proxy/mod.rs index b0964003..accd7aa2 100644 --- a/packages/core/src/api/proxy/mod.rs +++ b/packages/core/src/api/proxy/mod.rs @@ -185,7 +185,8 @@ pub enum IngressType { }, } -#[cfg_attr(feature = "tauri", derive(specta::Type, tauri_specta::Event))] +#[cfg_attr(feature = "tauri", derive(tauri_specta::Event))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Serialize, Clone)] pub struct IngressPayload { pub event: IngressType, @@ -194,19 +195,22 @@ pub struct IngressPayload { pub message: String, } -#[cfg_attr(feature = "tauri", derive(specta::Type, tauri_specta::Event))] +#[cfg_attr(feature = "tauri", derive(tauri_specta::Event))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Serialize, Clone)] pub struct OfflinePayload { pub offline: bool, } -#[cfg_attr(feature = "tauri", derive(specta::Type, tauri_specta::Event))] +#[cfg_attr(feature = "tauri", derive(tauri_specta::Event))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Serialize, Clone)] pub struct MessagePayload { pub message: String, } -#[cfg_attr(feature = "tauri", derive(specta::Type, tauri_specta::Event))] +#[cfg_attr(feature = "tauri", derive(tauri_specta::Event))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Serialize, Clone)] #[serde(tag = "event")] pub enum InternetPayload { @@ -215,7 +219,8 @@ pub enum InternetPayload { InstallPath { path: PathBuf }, } -#[cfg_attr(feature = "tauri", derive(specta::Type, tauri_specta::Event))] +#[cfg_attr(feature = "tauri", derive(tauri_specta::Event))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Serialize, Clone)] pub struct ProcessPayload { pub uuid: Uuid, @@ -234,7 +239,8 @@ pub enum ProcessPayloadType { Logging, } -#[cfg_attr(feature = "tauri", derive(specta::Type, tauri_specta::Event))] +#[cfg_attr(feature = "tauri", derive(tauri_specta::Event))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Serialize, Clone)] pub struct ClusterPayload { pub uuid: Uuid, diff --git a/packages/core/src/api/proxy/send.rs b/packages/core/src/api/proxy/send.rs index db463901..6e540b82 100644 --- a/packages/core/src/api/proxy/send.rs +++ b/packages/core/src/api/proxy/send.rs @@ -182,12 +182,7 @@ pub async fn send_offline(offline: bool) -> crate::Result<()> { let proxy_state = crate::ProxyState::get().await?; proxy_state .app - .emit( - OfflinePayload::NAME, - OfflinePayload { - offline, - }, - ) + .emit(OfflinePayload::NAME, OfflinePayload { offline }) .map_err(ProxyError::from)?; } @@ -201,10 +196,7 @@ pub async fn send_internet(internet: InternetPayload) -> crate::Result<()> { let proxy_state = crate::ProxyState::get().await?; proxy_state .app - .emit( - InternetPayload::NAME, - internet - ) + .emit(InternetPayload::NAME, internet) .map_err(ProxyError::from)?; } diff --git a/packages/core/src/game/mod.rs b/packages/core/src/game/mod.rs index 65d8e3cd..c7cfdab4 100644 --- a/packages/core/src/game/mod.rs +++ b/packages/core/src/game/mod.rs @@ -464,7 +464,7 @@ pub async fn launch_minecraft( command, post_hook, censors, - Some(credentials.id) + Some(credentials.id), ) .await } diff --git a/packages/core/src/store/clusters.rs b/packages/core/src/store/clusters.rs index 7c333969..b55ac9ad 100644 --- a/packages/core/src/store/clusters.rs +++ b/packages/core/src/store/clusters.rs @@ -24,7 +24,7 @@ use super::{Directories, InitHooks, Memory, Package, PackageType, Resolution}; pub(crate) struct Clusters(pub HashMap); /// Core Cluster stages used in package logic. -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Serialize, Deserialize, Clone, Copy, Debug, Default, Eq, PartialEq)] #[serde(rename_all = "snake_case")] pub enum ClusterStage { @@ -40,7 +40,7 @@ pub enum ClusterStage { } /// Relative Path wrapper to be used as an identifer for a cluster path. -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq, Hash)] #[serde(transparent)] pub struct ClusterPath(pub PathBuf); @@ -148,7 +148,7 @@ impl From for RawPackagePath { } /// Relative [`PathBuf`] for a specific [`Package`] of a [`Cluster`]. -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq, Hash)] #[serde(transparent)] pub struct PackagePath(pub PathBuf); @@ -195,7 +195,7 @@ impl PackagePath { /// Represents a single Instance and installation of Minecraft /// Contains settings and identifiers on a per-Cluster basis, falling back to default settings for Options<> -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Serialize, Deserialize, Clone, Debug)] pub struct Cluster { /// The Uuid of a specific cluster. @@ -228,7 +228,7 @@ pub struct Cluster { } /// Represents core Cluster metadata ([`Cluster#meta`]). -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Serialize, Deserialize, Clone, Debug)] pub struct ClusterMeta { /// The user-facing name of the cluster stored as a string. @@ -277,7 +277,7 @@ pub struct ClusterMeta { } /// Optional data used to link a specific cluster to a package project. -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Serialize, Deserialize, Clone, Debug)] pub struct PackageData { /// The package ID as a String. @@ -294,7 +294,7 @@ pub fn default_locked() -> Option { } /// Available mod loaders to be used for a cluster. -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Debug, Eq, PartialEq, Clone, Copy, Deserialize, Serialize, Default)] #[serde(rename_all = "lowercase")] pub enum Loader { @@ -328,7 +328,7 @@ impl std::fmt::Display for Loader { /// Custom Java arguments on a per-cluster basis. #[derive(Serialize, Deserialize, Clone, Debug)] -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] pub struct JavaOptions { /// A custom java version from the global java store, if specified. #[serde(skip_serializing_if = "Option::is_none")] diff --git a/packages/core/src/store/discord.rs b/packages/core/src/store/discord.rs index 616e806e..557c292e 100644 --- a/packages/core/src/store/discord.rs +++ b/packages/core/src/store/discord.rs @@ -61,9 +61,7 @@ impl DiscordRPC { let activity = Activity::new() .state(msg) - .buttons(vec![ - Button::new("Download", "https://polyfrost.org/"), - ]) + .buttons(vec![Button::new("Download", "https://polyfrost.org/")]) .assets( Assets::new() .large_image("polyfrost_logo_512") diff --git a/packages/core/src/store/java_versions.rs b/packages/core/src/store/java_versions.rs index ed4b8ded..7f85febd 100644 --- a/packages/core/src/store/java_versions.rs +++ b/packages/core/src/store/java_versions.rs @@ -8,7 +8,7 @@ use crate::utils::java; use crate::utils::java::JavaVersion; /// A HashMap of all located and installed available Java versions -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Debug, Serialize, Deserialize, Clone)] pub struct JavaVersions(HashMap); diff --git a/packages/core/src/store/minecraft.rs b/packages/core/src/store/minecraft.rs index c0c2997f..335f4fdb 100644 --- a/packages/core/src/store/minecraft.rs +++ b/packages/core/src/store/minecraft.rs @@ -365,7 +365,7 @@ pub struct SaveDeviceToken { /// Core variables passed throughout the Minecraft login flow. #[derive(Serialize, Deserialize, Debug)] -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] pub struct MinecraftLogin { pub verify: String, /// The OAuth challenge generated at the start of the flow. @@ -378,7 +378,7 @@ pub struct MinecraftLogin { /// A structure of all needed Minecraft credentials for logging in and account management. #[derive(Serialize, Deserialize, Debug, Clone)] -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] pub struct MinecraftCredentials { /// The uuid of the credentials. pub id: Uuid, diff --git a/packages/core/src/store/package.rs b/packages/core/src/store/package.rs index 4099cb1f..b28cf7df 100644 --- a/packages/core/src/store/package.rs +++ b/packages/core/src/store/package.rs @@ -83,7 +83,7 @@ pub async fn generate_context( } /// Represents types of packages handled by the launcher. -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Serialize, Deserialize, Clone, Debug)] #[serde(rename_all = "lowercase")] pub enum PackageType { @@ -151,7 +151,7 @@ impl PackageType { /// A struct that represents a Package. #[derive(Serialize, Deserialize, Clone, Debug)] -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] pub struct Package { pub sha512: String, pub meta: PackageMetadata, @@ -160,7 +160,7 @@ pub struct Package { } /// Metadata that represents a [`Package`]. -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Serialize, Deserialize, Clone, Debug)] #[serde(tag = "type", rename_all = "snake_case")] pub enum PackageMetadata { @@ -183,7 +183,7 @@ pub enum PackageMetadata { } /// Universal metadata for any managed package from a Mod distribution platform. -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Serialize, Deserialize, Clone, Debug)] pub struct ManagedPackage { // Core Metadata @@ -209,7 +209,7 @@ pub struct ManagedPackage { } /// Universal managed package version of a package. -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Serialize, Deserialize, Clone, Debug)] pub struct ManagedVersion { pub id: String, @@ -233,7 +233,7 @@ pub struct ManagedVersion { } /// Universal interface for managed package files. -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Serialize, Deserialize, PartialEq, Clone, Debug)] pub struct ManagedVersionFile { pub url: String, @@ -267,7 +267,7 @@ impl ManagedVersionFile { } /// Universal interface for managed package dependencies. -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Serialize, Deserialize, Clone, Debug)] pub struct ManagedDependency { pub version_id: Option, @@ -277,7 +277,7 @@ pub struct ManagedDependency { } /// Universal interface for managed package authors and users. -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Serialize, Deserialize, Clone, Debug)] pub struct ManagedUser { pub id: String, @@ -290,7 +290,7 @@ pub struct ManagedUser { } /// The type of a [`ManagedDependency`]. -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Serialize, Deserialize, Clone, Debug)] pub enum PackageDependency { Required, @@ -302,7 +302,7 @@ pub enum PackageDependency { /// The Client/Server side type of a [`Package`]. #[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq)] #[serde(rename_all = "snake_case")] -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] pub enum PackageSide { Required, Optional, @@ -311,7 +311,7 @@ pub enum PackageSide { } /// The file type of a [`Package`]. -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Serialize, Deserialize, PartialEq, Clone, Debug)] #[serde(rename_all = "snake_case")] pub enum PackageFile { diff --git a/packages/core/src/store/processor.rs b/packages/core/src/store/processor.rs index 1cb2f061..c3925db7 100644 --- a/packages/core/src/store/processor.rs +++ b/packages/core/src/store/processor.rs @@ -2,10 +2,10 @@ use chrono::{DateTime, TimeZone, Utc}; use serde::{Deserialize, Serialize}; -use tokio::io::{AsyncBufReadExt, BufReader}; use std::collections::HashMap; use std::process::Stdio; use std::sync::Arc; +use tokio::io::{AsyncBufReadExt, BufReader}; use tokio::process::{Child, Command}; use tokio::sync::RwLock; use tokio::task::JoinHandle; @@ -170,7 +170,7 @@ impl ChildType { exe, cluster_path, post, - user + user, }; let path = state.directories.caches_dir().await.join(PROCESSOR_FILE); @@ -463,7 +463,9 @@ impl Processor { censored = censored.replace(key, value); } - if let Err(err) = send_process(uuid, pid, ProcessPayloadType::Logging, &censored).await { + if let Err(err) = + send_process(uuid, pid, ProcessPayloadType::Logging, &censored).await + { tracing::warn!("failed to send process log: {}", err); }; } @@ -557,7 +559,12 @@ impl Processor { .id() .ok_or_else(|| anyhow::anyhow!("process failed, couldnt get pid"))?; process - .cache(cache.uuid, cache.cluster_path.clone(), cache.post.clone(), cache.user) + .cache( + cache.uuid, + cache.cluster_path.clone(), + cache.post.clone(), + cache.user, + ) .await?; let current_child = Arc::new(RwLock::new(process)); let manager = Some(tokio::spawn(Self::manager( @@ -580,7 +587,12 @@ impl Processor { let child = ProcessorChild { uuid: cache.uuid, cluster_path: cache.cluster_path, - started_at: Utc.timestamp_opt(cache.start_time as i64, 0).single().ok_or(anyhow::anyhow!("couldn't convert processor cache timestamp to Utc"))?, // TODO: Look into this + started_at: Utc + .timestamp_opt(cache.start_time as i64, 0) + .single() + .ok_or(anyhow::anyhow!( + "couldn't convert processor cache timestamp to Utc" + ))?, // TODO: Look into this current_child, manager, last_updated, diff --git a/packages/core/src/store/settings.rs b/packages/core/src/store/settings.rs index 5bba16f7..5096011c 100644 --- a/packages/core/src/store/settings.rs +++ b/packages/core/src/store/settings.rs @@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize}; use std::path::{Path, PathBuf}; /// A global settings state for the launcher. -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Debug, Serialize, Deserialize, Clone)] pub struct Settings { /// A OneLauncher [`Theme`] managed by the core GUI. @@ -133,7 +133,7 @@ impl Settings { } /// A OneLauncher theme managed by the GUI. -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Debug, Clone, Copy, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub enum Theme { @@ -149,7 +149,7 @@ pub enum Theme { /// Global memory settings across all clusters. #[derive(Serialize, Deserialize, Debug, Clone, Copy)] -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] pub struct Memory { /// Maximum amount of Java memory available globally. pub maximum: u32, @@ -168,7 +168,7 @@ impl Default for Memory { /// Global Minecraft resolution. #[derive(Serialize, Deserialize, Debug, Clone, Copy)] -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] pub struct Resolution(pub u16, pub u16); impl Default for Resolution { @@ -180,7 +180,7 @@ impl Default for Resolution { /// Global initialization hooks for all Minecraft clusters. #[derive(Serialize, Deserialize, Debug, Clone, Default)] #[serde(default)] -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] pub struct InitHooks { /// Pre-launch hook. #[serde(skip_serializing_if = "Option::is_none")] diff --git a/packages/core/src/utils/java.rs b/packages/core/src/utils/java.rs index 2b21f4b5..cdb0a5a0 100644 --- a/packages/core/src/utils/java.rs +++ b/packages/core/src/utils/java.rs @@ -26,7 +26,7 @@ use super::io; /// common java paths from https://github.com/PrismLauncher/PrismLauncher/blob/develop/launcher/java/JavaUtils.cpp under GPL 3.0 /// /// java check functionality from https://github.com/modrinth/theseus/blob/master/theseus/src/util/jre.rs under MIT -#[cfg_attr(feature = "tauri", derive(specta::Type))] +#[cfg_attr(feature = "specta", derive(specta::Type))] #[derive(Debug, PartialEq, Eq, Hash, Serialize, Deserialize, Clone)] pub struct JavaVersion { pub version: String,