diff --git a/src/archive/story.rs b/src/archive/story.rs index e759d5c..3a82624 100644 --- a/src/archive/story.rs +++ b/src/archive/story.rs @@ -22,7 +22,7 @@ pub struct Story { pub archive: Archive, #[serde(deserialize_with = "author_as_static")] pub author: Arc, - pub chapters: Vec, + pub chapters: Box<[Chapter]>, pub color: Option, pub completion_status: CompletionStatus, pub content_rating: ContentRating, @@ -31,7 +31,7 @@ pub struct Story { pub date_published: Option>, pub date_updated: Option>, #[serde(deserialize_with = "null_to_html")] - pub description_html: String, + pub description_html: Box, pub id: i64, pub num_chapters: i32, pub num_comments: i32, @@ -43,15 +43,15 @@ pub struct Story { pub published: bool, pub rating: i32, #[serde(deserialize_with = "null_to_text")] - pub short_description: String, + pub short_description: Box, pub status: Status, pub submitted: bool, #[serde(deserialize_with = "tags_as_static")] - pub tags: Vec>, + pub tags: Box<[Arc]>, #[serde(deserialize_with = "null_to_text")] - pub title: String, + pub title: Box, pub total_num_views: i32, - pub url: String, + pub url: Box, } #[derive(Clone, Debug, Deserialize)] @@ -61,51 +61,51 @@ pub struct Archive { pub date_created: Option>, pub date_fetched: Option>, pub date_updated: Option>, - pub path: String, + pub path: Box, } #[derive(Clone, Debug, Deserialize, PartialEq, Eq, Hash)] #[serde(deny_unknown_fields)] pub struct Author { pub avatar: Option, - pub bio_html: Option, + pub bio_html: Option>, pub date_joined: Option>, #[serde(deserialize_with = "string_to_id")] pub id: i64, - pub name: String, + pub name: Box, pub num_blog_posts: Option, pub num_followers: Option, pub num_stories: Option, - pub url: String, + pub url: Box, } #[derive(Clone, Debug, Deserialize, PartialEq, Eq, Hash)] #[serde(deny_unknown_fields)] pub struct Avatar { #[serde(rename = "16")] - pub x16: Option, + pub x16: Option>, #[serde(rename = "32")] - pub x32: Option, + pub x32: Option>, #[serde(rename = "48")] - pub x48: Option, + pub x48: Option>, #[serde(rename = "64")] - pub x64: Option, + pub x64: Option>, #[serde(rename = "96")] - pub x96: Option, + pub x96: Option>, #[serde(rename = "128")] - pub x128: Option, + pub x128: Option>, #[serde(rename = "160")] - pub x160: Option, + pub x160: Option>, #[serde(rename = "192")] - pub x192: Option, + pub x192: Option>, #[serde(rename = "256")] - pub x256: Option, + pub x256: Option>, #[serde(rename = "320")] - pub x320: Option, + pub x320: Option>, #[serde(rename = "384")] - pub x384: Option, + pub x384: Option>, #[serde(rename = "512")] - pub x512: Option, + pub x512: Option>, } #[derive(Clone, Debug, Deserialize)] @@ -119,8 +119,8 @@ pub struct Chapter { pub num_words: i32, pub published: bool, #[serde(deserialize_with = "null_to_text")] - pub title: String, - pub url: String, + pub title: Box, + pub url: Box, } #[derive(Clone, Debug)] @@ -151,10 +151,10 @@ pub enum ContentRating { #[derive(Clone, Debug, Deserialize)] #[serde(deny_unknown_fields)] pub struct CoverImage { - pub full: String, - pub large: String, - pub medium: String, - pub thumbnail: String, + pub full: Box, + pub large: Box, + pub medium: Box, + pub thumbnail: Box, } #[derive(Clone, Debug, Deserialize)] @@ -170,29 +170,29 @@ pub enum Status { #[serde(deny_unknown_fields)] pub struct Tag { pub id: i64, - pub name: String, - pub old_id: String, - pub r#type: String, - pub url: String, + pub name: Box, + pub old_id: Box, + pub r#type: Box, + pub url: Box, } -fn null_to_html<'de, D>(d: D) -> Result +fn null_to_html<'de, D>(d: D) -> Result, D::Error> where D: Deserializer<'de>, { match Option::deserialize(d)? { Some(text) => Ok(text), - None => Ok(String::from("

")), + None => Ok(Box::from("

")), } } -fn null_to_text<'de, D>(d: D) -> Result +fn null_to_text<'de, D>(d: D) -> Result, D::Error> where D: Deserializer<'de>, { match Option::deserialize(d)? { Some(text) => Ok(text), - None => Ok(String::from("")), + None => Ok(Box::from("")), } } @@ -220,7 +220,7 @@ where Author::deserialize(d).map(|author| AUTHORS.intern(author)) } -fn tags_as_static<'de, D>(d: D) -> Result>, D::Error> +fn tags_as_static<'de, D>(d: D) -> Result]>, D::Error> where D: Deserializer<'de>, {