From 70a85e9796c2c35404edee72df69281da3272e27 Mon Sep 17 00:00:00 2001 From: Timo Ley Date: Thu, 8 Dec 2022 13:20:04 +0100 Subject: [PATCH] chore: move AddonDescriptor from api to lib --- crates/model/src/api.rs | 9 ++------- crates/model/src/lib.rs | 7 +++++++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/crates/model/src/api.rs b/crates/model/src/api.rs index b247b6e..fc53457 100644 --- a/crates/model/src/api.rs +++ b/crates/model/src/api.rs @@ -1,5 +1,7 @@ use serde::{Deserialize, Serialize}; +use crate::AddonDescriptor; + use super::{AddonScript, File, Hashes, Meta}; #[derive(Debug, Serialize, Deserialize)] @@ -20,13 +22,6 @@ pub struct APIFile { pub meta: Option, } -#[derive(Debug, Serialize, Deserialize)] -pub struct AddonDescriptor { - pub id: String, - pub namespace: String, - pub version: String, -} - #[derive(Debug, Serialize, Deserialize)] pub struct EnvObject { #[serde(skip_serializing_if = "Option::is_none")] diff --git a/crates/model/src/lib.rs b/crates/model/src/lib.rs index 81dc47e..f4a3a55 100644 --- a/crates/model/src/lib.rs +++ b/crates/model/src/lib.rs @@ -44,6 +44,13 @@ impl Default for AddonScript { } } +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] +pub struct AddonDescriptor { + pub id: String, + pub namespace: String, + pub version: Option, +} + #[derive(Debug, Serialize, Deserialize)] pub struct Repository { pub namespace: String,