From bf818bb4081f9b3ca00bcd82a9db5b5bc992af88 Mon Sep 17 00:00:00 2001 From: Franklin Date: Thu, 4 May 2023 11:26:14 -0400 Subject: [PATCH] Cargo fmt --- src/domain/click.rs | 6 +++--- src/domain/clickable/impls.rs | 2 +- src/domain/clickable/mod.rs | 2 +- src/domain/error.rs | 3 +-- src/domain/mod.rs | 14 +++++++------- src/domain/project.rs | 15 +++++++++------ src/domain/project_condition/mod.rs | 2 +- src/domain/project_type/mod.rs | 3 +-- src/domain/property.rs | 8 ++++---- src/domain/realtor.rs | 4 ++-- src/domain/thing_pk/impls.rs | 7 +++---- src/domain/thing_pk/mod.rs | 2 +- src/domain/trackable.rs | 4 ++-- src/domain/view.rs | 6 +++--- src/dto/mod.rs | 2 +- src/dto/payloads/mod.rs | 1 + src/lib.rs | 2 +- src/traits/impls/mod.rs | 2 +- src/traits/impls/readable.rs | 2 -- src/traits/mod.rs | 2 +- src/traits/readable.rs | 3 +-- 21 files changed, 45 insertions(+), 47 deletions(-) diff --git a/src/domain/click.rs b/src/domain/click.rs index 7995e03..85e32b1 100644 --- a/src/domain/click.rs +++ b/src/domain/click.rs @@ -1,5 +1,5 @@ use chrono::{DateTime, Utc}; -use serde::{Serialize, Deserialize}; +use serde::{Deserialize, Serialize}; use uuid::Uuid; use super::clickable::Clickable; @@ -14,5 +14,5 @@ pub struct Click { #[serde(rename = "trackableId")] pub trackable_id: Uuid, #[serde(rename = "timeCreated")] - pub time_created: DateTime -} \ No newline at end of file + pub time_created: DateTime, +} diff --git a/src/domain/clickable/impls.rs b/src/domain/clickable/impls.rs index 9f623d1..afa4955 100644 --- a/src/domain/clickable/impls.rs +++ b/src/domain/clickable/impls.rs @@ -32,4 +32,4 @@ impl sqlx::Type for Clickable { fn compatible(ty: &::TypeInfo) -> bool { *ty == Self::type_info() } -} \ No newline at end of file +} diff --git a/src/domain/clickable/mod.rs b/src/domain/clickable/mod.rs index 63ae9bf..c97b544 100644 --- a/src/domain/clickable/mod.rs +++ b/src/domain/clickable/mod.rs @@ -13,4 +13,4 @@ impl Default for Clickable { fn default() -> Self { Self::Contact(String::default()) } -} \ No newline at end of file +} diff --git a/src/domain/error.rs b/src/domain/error.rs index 90d88b9..91a45da 100644 --- a/src/domain/error.rs +++ b/src/domain/error.rs @@ -1,6 +1,5 @@ use std::fmt::Display; - #[derive(Debug, Default, PartialEq, Eq, PartialOrd, Ord)] pub struct FromStrError; @@ -10,4 +9,4 @@ impl Display for FromStrError { } } -impl std::error::Error for FromStrError {} \ No newline at end of file +impl std::error::Error for FromStrError {} diff --git a/src/domain/mod.rs b/src/domain/mod.rs index 0133e85..f448341 100644 --- a/src/domain/mod.rs +++ b/src/domain/mod.rs @@ -1,16 +1,16 @@ -pub mod property; -pub mod realtor; -pub mod view; -pub mod project; -pub mod media; -pub mod thing_pk; pub mod click; pub mod clickable; -pub mod trackable; +pub mod media; +pub mod project; pub mod project_condition; pub mod project_state; +pub mod property; pub mod property_sale_type; pub mod property_type; +pub mod realtor; +pub mod thing_pk; +pub mod trackable; +pub mod view; pub mod error; pub mod project_type; diff --git a/src/domain/project.rs b/src/domain/project.rs index 9a4e20e..492d342 100644 --- a/src/domain/project.rs +++ b/src/domain/project.rs @@ -1,8 +1,11 @@ -use chrono::{DateTime, Utc, NaiveDate}; -use serde::{Serialize, Deserialize}; +use chrono::{DateTime, NaiveDate, Utc}; +use serde::{Deserialize, Serialize}; use uuid::Uuid; -use super::{media::MediaList, project_condition::ProjectCondition, project_type::ProjectType, project_state::ProjectState}; +use super::{ + media::MediaList, project_condition::ProjectCondition, project_state::ProjectState, + project_type::ProjectType, +}; #[derive(Serialize, Deserialize, Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord)] pub struct Project { @@ -26,11 +29,11 @@ pub struct Project { pub floors: i16, #[serde(rename = "finishDate")] pub finish_date: NaiveDate, - /// This gives the realtor the option to order the projects/properties. On birth, + /// This gives the realtor the option to order the projects/properties. On birth, #[serde(rename = "orderIndex")] pub order_index: i32, #[serde(rename = "timeCreated")] pub time_created: DateTime, #[serde(rename = "lastUpdated")] - pub last_updated: DateTime -} \ No newline at end of file + pub last_updated: DateTime, +} diff --git a/src/domain/project_condition/mod.rs b/src/domain/project_condition/mod.rs index 8953049..a5ce807 100644 --- a/src/domain/project_condition/mod.rs +++ b/src/domain/project_condition/mod.rs @@ -2,7 +2,7 @@ use std::{fmt::Display, str::FromStr}; use serde::{Deserialize, Serialize}; -use super::error::{FromStrError}; +use super::error::FromStrError; #[cfg(feature = "sqlx")] pub mod impls; diff --git a/src/domain/project_type/mod.rs b/src/domain/project_type/mod.rs index 07d3bbe..1eda4b7 100644 --- a/src/domain/project_type/mod.rs +++ b/src/domain/project_type/mod.rs @@ -4,7 +4,7 @@ use std::{fmt::Display, str::FromStr}; use serde::{Deserialize, Serialize}; -use super::error::{FromStrError}; +use super::error::FromStrError; #[derive(Serialize, Deserialize, Debug, Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord)] pub enum ProjectType { @@ -19,7 +19,6 @@ pub enum ProjectType { Housing, /// Fields (cap cana, pc, quintas) Project, - } impl Display for ProjectType { diff --git a/src/domain/property.rs b/src/domain/property.rs index d56bbde..72e6c23 100644 --- a/src/domain/property.rs +++ b/src/domain/property.rs @@ -1,8 +1,8 @@ use chrono::{DateTime, Utc}; -use serde::{Serialize, Deserialize}; +use serde::{Deserialize, Serialize}; use uuid::Uuid; -use super::{media::MediaList, property_type::PropertyType, property_sale_type::PropertySaleType}; +use super::{media::MediaList, property_sale_type::PropertySaleType, property_type::PropertyType}; /// A property can belong to a project, or not. It should always belong to a realtor. #[derive(Serialize, Deserialize, Debug, Default, Clone, PartialEq, PartialOrd)] @@ -36,5 +36,5 @@ pub struct Property { #[serde(rename = "timeCreated")] pub time_created: DateTime, #[serde(rename = "lastUpdated")] - pub last_updated: DateTime -} \ No newline at end of file + pub last_updated: DateTime, +} diff --git a/src/domain/realtor.rs b/src/domain/realtor.rs index a193810..87cea2f 100644 --- a/src/domain/realtor.rs +++ b/src/domain/realtor.rs @@ -1,5 +1,5 @@ use chrono::{DateTime, Utc}; -use serde::{Serialize, Deserialize}; +use serde::{Deserialize, Serialize}; use uuid::Uuid; #[derive(Serialize, Deserialize, Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord)] @@ -21,4 +21,4 @@ pub struct Realtor { pub time_created: DateTime, #[serde(rename = "lastUpdated")] pub last_updated: DateTime, -} \ No newline at end of file +} diff --git a/src/domain/thing_pk/impls.rs b/src/domain/thing_pk/impls.rs index 5081384..a8d2a9f 100644 --- a/src/domain/thing_pk/impls.rs +++ b/src/domain/thing_pk/impls.rs @@ -1,4 +1,4 @@ -use std::{str::FromStr, fmt::Display}; +use std::{fmt::Display, str::FromStr}; use sqlx::{ encode::IsNull, @@ -11,7 +11,6 @@ use crate::domain::error::FromStrError; use super::ThingPk; - impl Display for ThingPk { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { @@ -30,7 +29,7 @@ impl FromStr for ThingPk { "Project" => Ok(Self::Project), "Realtor" => Ok(Self::Realtor), "Property" => Ok(Self::Property), - _ => Err(FromStrError) + _ => Err(FromStrError), } } } @@ -61,4 +60,4 @@ impl sqlx::Type for ThingPk { fn compatible(ty: &::TypeInfo) -> bool { *ty == Self::type_info() } -} \ No newline at end of file +} diff --git a/src/domain/thing_pk/mod.rs b/src/domain/thing_pk/mod.rs index 6f0b982..8031a17 100644 --- a/src/domain/thing_pk/mod.rs +++ b/src/domain/thing_pk/mod.rs @@ -8,4 +8,4 @@ pub enum ThingPk { Realtor, Property, Project, -} \ No newline at end of file +} diff --git a/src/domain/trackable.rs b/src/domain/trackable.rs index 9dd6134..8f0c69f 100644 --- a/src/domain/trackable.rs +++ b/src/domain/trackable.rs @@ -1,5 +1,5 @@ use chrono::{DateTime, Utc}; -use serde::{Serialize, Deserialize}; +use serde::{Deserialize, Serialize}; use uuid::Uuid; /// A user that can be tracked. All the info that you can gather from the user based on their browser & IP network. @@ -21,4 +21,4 @@ pub struct Trackable { #[serde(rename = "userAgent")] pub user_agent: String, pub time_created: DateTime, -} \ No newline at end of file +} diff --git a/src/domain/view.rs b/src/domain/view.rs index 03d83c9..d3209a1 100644 --- a/src/domain/view.rs +++ b/src/domain/view.rs @@ -1,5 +1,5 @@ use chrono::{DateTime, Utc}; -use serde::{Serialize, Deserialize}; +use serde::{Deserialize, Serialize}; use uuid::Uuid; use super::thing_pk::ThingPk; @@ -14,5 +14,5 @@ pub struct View { #[serde(rename = "trackableId")] pub trackable_id: Uuid, #[serde(rename = "timeCreated")] - pub time_created: DateTime -} \ No newline at end of file + pub time_created: DateTime, +} diff --git a/src/dto/mod.rs b/src/dto/mod.rs index 7a8b2c5..01074c6 100644 --- a/src/dto/mod.rs +++ b/src/dto/mod.rs @@ -1 +1 @@ -pub mod payloads; \ No newline at end of file +pub mod payloads; diff --git a/src/dto/payloads/mod.rs b/src/dto/payloads/mod.rs index e69de29..8b13789 100644 --- a/src/dto/payloads/mod.rs +++ b/src/dto/payloads/mod.rs @@ -0,0 +1 @@ + diff --git a/src/lib.rs b/src/lib.rs index a422a51..7178f3c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,3 @@ pub mod domain; pub mod dto; -pub mod traits; \ No newline at end of file +pub mod traits; diff --git a/src/traits/impls/mod.rs b/src/traits/impls/mod.rs index 4b12107..fd39af6 100644 --- a/src/traits/impls/mod.rs +++ b/src/traits/impls/mod.rs @@ -1 +1 @@ -pub mod readable; \ No newline at end of file +pub mod readable; diff --git a/src/traits/impls/readable.rs b/src/traits/impls/readable.rs index 3262b00..be27595 100644 --- a/src/traits/impls/readable.rs +++ b/src/traits/impls/readable.rs @@ -1,3 +1 @@ //use crate::traits::readable::Readable; - - diff --git a/src/traits/mod.rs b/src/traits/mod.rs index 2312280..8f96c81 100644 --- a/src/traits/mod.rs +++ b/src/traits/mod.rs @@ -1,2 +1,2 @@ +pub mod impls; pub mod readable; -pub mod impls; \ No newline at end of file diff --git a/src/traits/readable.rs b/src/traits/readable.rs index c3a61e7..da9e894 100644 --- a/src/traits/readable.rs +++ b/src/traits/readable.rs @@ -1,4 +1,3 @@ - pub trait Readable { fn to_human_readable(&self) -> String; -} \ No newline at end of file +}