From 21564c2ae6e35cce6e314e37f38efda0d1de5b7e Mon Sep 17 00:00:00 2001 From: Timo Ley Date: Mon, 28 Nov 2022 11:06:15 +0100 Subject: [PATCH] chore: format --- crates/model/src/api.rs | 4 ++-- crates/model/src/enums.rs | 4 ++-- crates/model/src/lib.rs | 19 ++++++++++--------- crates/model/src/meta.rs | 4 ++-- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/crates/model/src/api.rs b/crates/model/src/api.rs index f18991c..b247b6e 100644 --- a/crates/model/src/api.rs +++ b/crates/model/src/api.rs @@ -18,7 +18,7 @@ pub struct APIFile { pub hashes: Option, #[serde(skip_serializing_if = "Option::is_none")] pub meta: Option, -} +} #[derive(Debug, Serialize, Deserialize)] pub struct AddonDescriptor { @@ -49,4 +49,4 @@ pub struct EnvBuilderRequest { pub struct EnvBuilderResponse { pub addonscript: AddonScript, pub files: Vec, -} \ No newline at end of file +} diff --git a/crates/model/src/enums.rs b/crates/model/src/enums.rs index 29651cf..e35a73b 100644 --- a/crates/model/src/enums.rs +++ b/crates/model/src/enums.rs @@ -9,7 +9,7 @@ pub enum Flag { Instance, Incompatible, Launch, - Env + Env, } #[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Hash)] @@ -20,4 +20,4 @@ pub enum InstallAction { Rename, Inject, Unknown(String), -} \ No newline at end of file +} diff --git a/crates/model/src/lib.rs b/crates/model/src/lib.rs index b1e12ee..81dc47e 100644 --- a/crates/model/src/lib.rs +++ b/crates/model/src/lib.rs @@ -2,11 +2,14 @@ use std::collections::HashSet; use serde::{Deserialize, Serialize}; -pub use self::{enums::{Flag, InstallAction}, meta::*}; +pub use self::{ + enums::{Flag, InstallAction}, + meta::*, +}; pub mod api; -pub mod meta; pub mod enums; +pub mod meta; #[derive(Debug, Serialize, Deserialize)] pub struct Manifest { @@ -15,7 +18,7 @@ pub struct Manifest { pub namespace: String, pub version: String, #[serde(skip_serializing_if = "Option::is_none")] - pub files : Option>, + pub files: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub relations: Option>, pub flags: Flags, @@ -60,7 +63,7 @@ pub struct Relation { } #[derive(Debug, Serialize, Deserialize)] -pub struct File { +pub struct File { pub qualifier: String, pub link: Vec, #[serde(skip_serializing_if = "Option::is_none")] @@ -101,7 +104,6 @@ impl VersionlessManifest { } impl Flags { - pub fn has_client_flag(&self, flag: &Flag) -> bool { if let Some(flags) = &self.client { if flags.contains(flag) { @@ -113,7 +115,7 @@ impl Flags { return true; } } - return false; + false } pub fn has_server_flag(&self, flag: &Flag) -> bool { @@ -127,7 +129,6 @@ impl Flags { return true; } } - return false; + false } - -} \ No newline at end of file +} diff --git a/crates/model/src/meta.rs b/crates/model/src/meta.rs index 6616c98..70aa20c 100644 --- a/crates/model/src/meta.rs +++ b/crates/model/src/meta.rs @@ -40,11 +40,11 @@ pub struct VersionMeta { #[serde(skip_serializing_if = "Option::is_none")] pub changelog: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub timestamp:Option, + pub timestamp: Option, } #[derive(Debug, Serialize, Deserialize, Clone)] pub struct Contributor { pub name: String, pub email: String, -} \ No newline at end of file +}