diff --git a/Cargo.lock b/Cargo.lock index 06ce0f3..9f6a952 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -157,6 +157,17 @@ dependencies = [ "byte-tools", ] +[[package]] +name = "bstr" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a40b47ad93e1a5404e6c18dec46b628214fee441c70f4ab5d6942142cc268a3d" +dependencies = [ + "lazy_static", + "memchr", + "regex-automata", +] + [[package]] name = "bumpalo" version = "2.6.0" @@ -2341,6 +2352,16 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" +[[package]] +name = "opener" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea3ebcd72a54701f56345f16785a6d3ac2df7e986d273eb4395c0b01db17952" +dependencies = [ + "bstr", + "winapi 0.3.9", +] + [[package]] name = "ordered-float" version = "2.0.1" @@ -2728,6 +2749,12 @@ dependencies = [ "regex-syntax", ] +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" + [[package]] name = "regex-syntax" version = "0.6.25" @@ -3086,6 +3113,7 @@ dependencies = [ "json5", "json_comments", "native-dialog", + "opener", "reqwest", "serde", "serde-aux", diff --git a/Cargo.toml b/Cargo.toml index 4cea6e1..6642983 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,6 +22,7 @@ serde-aux = "2.1.1" handwritten-json = { git = "https://github.com/atlanticaccent/rust-handwritten-json.git" } zip = "0.5.9" unrar = "0.4.4" +opener = "0.5" [target.'cfg(unix)'.dependencies] compress-tools = "0.11.1" diff --git a/src/gui/install.rs b/src/gui/install.rs index 19a7d25..fb67976 100644 --- a/src/gui/install.rs +++ b/src/gui/install.rs @@ -9,7 +9,7 @@ use std::{ use tokio::fs::{remove_dir_all, rename}; use crate::archive_handler; -use crate::gui::mod_list::{ModEntry, ModVersionMeta, ModVersion}; +use crate::gui::mod_list::{ModEntry, ModVersionMeta}; #[derive(Debug, Clone)] pub enum InstallError { @@ -141,7 +141,7 @@ fn copy_dir_recursive(to: &PathBuf, from: &PathBuf) -> io::Result<()> { Ok(()) } -pub async fn get_master_version(local: ModVersionMeta) -> (String, Result, String>) { +pub async fn get_master_version(local: ModVersionMeta) -> (String, Result, String>) { let res = send_request(local.remote_url.clone()).await; match res { @@ -156,11 +156,7 @@ pub async fn get_master_version(local: ModVersionMeta) -> (String, Result