File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,8 @@ struct Crates {
1414struct Crate {
1515 id : String ,
1616 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 > ,
2019 #[ serde( rename = "updated_at" ) ]
2120 updated : String ,
2221 downloads : u64 ,
@@ -55,7 +54,14 @@ pub async fn search(args: Arc<Args>) -> Result<(), Error> {
5554 e. title ( & krate. name )
5655 . url ( format ! ( "https://crates.io/crates/{}" , krate. id) )
5756 . 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+ )
5965 . field ( "downloads" , & krate. downloads , true )
6066 . timestamp ( krate. updated . as_str ( ) )
6167 } ) ;
You can’t perform that action at this time.
0 commit comments