File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -342,7 +342,7 @@ impl Crate {
342
342
} ;
343
343
let keyword_ids = keywords. map ( |kws| kws. iter ( ) . map ( |kw| kw. keyword . clone ( ) ) . collect ( ) ) ;
344
344
let category_ids = categories. map ( |cats| cats. iter ( ) . map ( |cat| cat. slug . clone ( ) ) . collect ( ) ) ;
345
- let badges = badges. map ( |bs| bs. into_iter ( ) . map ( Badge :: encodable ) . collect ( ) ) ;
345
+ let badges = badges. map ( |bs| bs. into_iter ( ) . map ( Badge :: into ) . collect ( ) ) ;
346
346
let documentation = Crate :: remove_blocked_documentation_urls ( documentation) ;
347
347
348
348
EncodableCrate {
Original file line number Diff line number Diff line change 1
1
use chrono:: NaiveDateTime ;
2
2
use std:: collections:: HashMap ;
3
3
4
- use crate :: models:: DependencyKind ;
4
+ use crate :: models:: { Badge , DependencyKind } ;
5
5
use crate :: util:: rfc3339;
6
6
7
7
#[ derive( PartialEq , Debug , Serialize , Deserialize ) ]
@@ -10,6 +10,12 @@ pub struct EncodableBadge {
10
10
pub attributes : HashMap < String , Option < String > > ,
11
11
}
12
12
13
+ impl From < Badge > for EncodableBadge {
14
+ fn from ( badge : Badge ) -> Self {
15
+ badge. encodable ( )
16
+ }
17
+ }
18
+
13
19
#[ derive( Serialize , Deserialize , Debug ) ]
14
20
pub struct EncodableCategory {
15
21
pub id : String ,
You can’t perform that action at this time.
0 commit comments