diff options
author | 2021-05-14 07:20:01 -0700 | |
---|---|---|
committer | 2021-05-14 07:20:01 -0700 | |
commit | b22ae2cf8a9e2b6af1a54f79ecdb31ad4d2c31c5 (patch) | |
tree | e6f9e1dcfcf6aed2a09517ce08d276b6ce9e2b79 /src/models.rs | |
parent | f7ef8d6d7f009990ba0c6be61cca507f097673b6 (diff) | |
download | notion-b22ae2cf8a9e2b6af1a54f79ecdb31ad4d2c31c5.tar.gz notion-b22ae2cf8a9e2b6af1a54f79ecdb31ad4d2c31c5.tar.zst notion-b22ae2cf8a9e2b6af1a54f79ecdb31ad4d2c31c5.zip |
clean code
Diffstat (limited to 'src/models.rs')
-rw-r--r-- | src/models.rs | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/src/models.rs b/src/models.rs index c11c97b..cfb43d9 100644 --- a/src/models.rs +++ b/src/models.rs @@ -1,7 +1,7 @@ pub mod search; -use serde::{Serialize, Deserialize}; use chrono::{DateTime, Utc}; +use serde::{Deserialize, Serialize}; use std::collections::HashMap; #[derive(Serialize, Deserialize, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] @@ -108,15 +108,11 @@ pub struct Select { pub enum PropertyConfiguration { /// Represents the special Title property required on every database. /// See https://developers.notion.com/reference/database#title-configuration - Title { - id: PropertyId, - }, + Title { id: PropertyId }, /// Represents a Text property /// https://developers.notion.com/reference/database#text-configuration #[serde(rename = "rich_text")] - Text { - id: PropertyId, - }, + Text { id: PropertyId }, /// Represents a Number Property /// See https://developers.notion.com/reference/database#number-configuration Number { @@ -126,20 +122,13 @@ pub enum PropertyConfiguration { }, /// Represents a Select Property /// See https://developers.notion.com/reference/database#select-configuration - Select { - id: PropertyId, - select: Select, - }, + Select { id: PropertyId, select: Select }, /// Represents a Date Property /// See https://developers.notion.com/reference/database#date-configuration - Date { - id: PropertyId - }, + Date { id: PropertyId }, /// Represents a File Property /// See https://developers.notion.com/reference/database#date-configuration - File { - id: PropertyId - }, + File { id: PropertyId }, } #[derive(Serialize, Deserialize, Debug, Eq, PartialEq)] @@ -189,7 +178,7 @@ struct RichTextCommon { #[derive(Serialize, Deserialize, Debug, Eq, PartialEq)] pub struct Link { - url: String + url: String, } #[derive(Serialize, Deserialize, Debug, Eq, PartialEq)] @@ -217,6 +206,5 @@ pub enum RichText { Equation { #[serde(flatten)] rich_text: RichTextCommon, - }, } |