File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,8 @@ struct Crates {
14
14
struct Crate {
15
15
id : String ,
16
16
name : String ,
17
- #[ serde( rename = "newest_version" ) ]
18
- version : String ,
19
- max_stable_version : String ,
17
+ newest_version : String ,
18
+ max_stable_version : Option < String > ,
20
19
#[ serde( rename = "updated_at" ) ]
21
20
updated : String ,
22
21
downloads : u64 ,
@@ -55,7 +54,14 @@ pub async fn search(args: Arc<Args>) -> Result<(), Error> {
55
54
e. title ( & krate. name )
56
55
. url ( format ! ( "https://crates.io/crates/{}" , krate. id) )
57
56
. description ( & krate. description )
58
- . field ( "version" , & krate. max_stable_version , true )
57
+ . field (
58
+ "version" ,
59
+ krate
60
+ . max_stable_version
61
+ . as_ref ( )
62
+ . unwrap_or ( & krate. newest_version ) ,
63
+ true ,
64
+ )
59
65
. field ( "downloads" , & krate. downloads , true )
60
66
. timestamp ( krate. updated . as_str ( ) )
61
67
} ) ;
You can’t perform that action at this time.
0 commit comments