From 5d679ca8cdc2e79b6e6db7dd7ca2fc099da5a709 Mon Sep 17 00:00:00 2001 From: GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> Date: Mon, 17 Jul 2023 19:42:28 +0200 Subject: feat: Implement `to_string` for `ParsedThunderstoreModString` (#420) Allows printing `ParsedThunderstoreModString` in the Thunderstore mod string format --- src-tauri/src/mod_management/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src-tauri/src/mod_management/mod.rs b/src-tauri/src/mod_management/mod.rs index a2aca85a..6c45a23b 100644 --- a/src-tauri/src/mod_management/mod.rs +++ b/src-tauri/src/mod_management/mod.rs @@ -36,6 +36,12 @@ impl std::str::FromStr for ParsedThunderstoreModString { } } +impl ToString for ParsedThunderstoreModString { + fn to_string(&self) -> String { + format!("{}-{}-{}", self.author_name, self.mod_name, self.version) + } +} + #[derive(Serialize, Deserialize, Debug, Clone)] pub struct ThunderstoreManifest { name: String, -- cgit v1.2.3