1- use super :: { markdown , match_version, MetaData } ;
1+ use super :: { match_version, MetaData } ;
22use crate :: registry_api:: OwnerKind ;
33use crate :: utils:: { get_correct_docsrs_style_file, report_error} ;
44use crate :: web:: rustdoc:: RustdocHtmlParams ;
@@ -27,22 +27,19 @@ use log::warn;
2727use rinja:: Template ;
2828use semver:: Version ;
2929use serde:: Deserialize ;
30- use serde:: { ser:: Serializer , Serialize } ;
3130use serde_json:: Value ;
3231use std:: sync:: Arc ;
3332
3433// TODO: Add target name and versions
3534
36- #[ derive( Debug , Clone , PartialEq , Serialize ) ]
35+ #[ derive( Debug , Clone , PartialEq ) ]
3736pub ( crate ) struct CrateDetails {
3837 pub ( crate ) name : String ,
3938 pub ( crate ) version : Version ,
4039 pub ( crate ) description : Option < String > ,
4140 pub ( crate ) owners : Vec < ( String , String , OwnerKind ) > ,
4241 pub ( crate ) dependencies : Option < Value > ,
43- #[ serde( serialize_with = "optional_markdown" ) ]
4442 readme : Option < String > ,
45- #[ serde( serialize_with = "optional_markdown" ) ]
4643 rustdoc : Option < String > , // this is description_long in database
4744 release_time : Option < DateTime < Utc > > ,
4845 build_status : BuildStatus ,
@@ -71,25 +68,15 @@ pub(crate) struct CrateDetails {
7168 pub ( crate ) release_id : i32 ,
7269}
7370
74- #[ derive( Debug , Clone , PartialEq , Serialize ) ]
71+ #[ derive( Debug , Clone , PartialEq ) ]
7572struct RepositoryMetadata {
7673 stars : i32 ,
7774 forks : i32 ,
7875 issues : i32 ,
7976 name : Option < String > ,
8077}
8178
82- fn optional_markdown < S > ( markdown : & Option < String > , serializer : S ) -> Result < S :: Ok , S :: Error >
83- where
84- S : Serializer ,
85- {
86- markdown
87- . as_ref ( )
88- . map ( |markdown| markdown:: render ( markdown) )
89- . serialize ( serializer)
90- }
91-
92- #[ derive( Debug , Clone , Eq , PartialEq , Serialize ) ]
79+ #[ derive( Debug , Clone , Eq , PartialEq ) ]
9380pub ( crate ) struct Release {
9481 pub id : i32 ,
9582 pub version : semver:: Version ,
@@ -425,7 +412,7 @@ pub(crate) async fn releases_for_crate(
425412
426413#[ derive( Template ) ]
427414#[ template( path = "crate/details.html" ) ]
428- #[ derive( Debug , Clone , PartialEq , Serialize ) ]
415+ #[ derive( Debug , Clone , PartialEq ) ]
429416struct CrateDetailsPage {
430417 details : CrateDetails ,
431418 csp_nonce : String ,
@@ -507,7 +494,7 @@ pub(crate) async fn crate_details_handler(
507494
508495#[ derive( Template ) ]
509496#[ template( path = "rustdoc/releases.html" ) ]
510- #[ derive( Debug , Clone , PartialEq , Serialize ) ]
497+ #[ derive( Debug , Clone , PartialEq ) ]
511498struct ReleaseList {
512499 releases : Vec < Release > ,
513500 crate_name : String ,
@@ -600,7 +587,7 @@ pub(crate) async fn get_all_releases(
600587 Ok ( res. into_response ( ) )
601588}
602589
603- #[ derive( Debug , Clone , PartialEq , Serialize ) ]
590+ #[ derive( Debug , Clone , PartialEq ) ]
604591struct ShortMetadata {
605592 name : String ,
606593 version : Version ,
@@ -617,7 +604,7 @@ impl ShortMetadata {
617604
618605#[ derive( Template ) ]
619606#[ template( path = "rustdoc/platforms.html" ) ]
620- #[ derive( Debug , Clone , PartialEq , Serialize ) ]
607+ #[ derive( Debug , Clone , PartialEq ) ]
621608struct PlatformList {
622609 metadata : ShortMetadata ,
623610 inner_path : String ,
0 commit comments