@@ -7,16 +7,17 @@ use crate::rinth::structs::version::Version;
77use crate :: rinth:: url:: { UrlJoinAll , UrlWithQuery } ;
88use crate :: rinth:: Rinth ;
99use anyhow:: Result ;
10+ use crate :: rinth:: request:: RequestBuilderCustomSend ;
1011
1112impl Rinth {
1213 pub async fn version_list ( & self , project_id : & str ) -> Result < Vec < Version > > {
1314 check_id_slug ( & [ project_id] ) ?;
1415 self . request
1516 . get ( self . base_url . join_all ( vec ! [ "project" , project_id, "version" ] ) )
16- . custom_send_json ( )
17+ . await . custom_send_json ( )
1718 . await
1819 }
19-
20+
2021 pub async fn version_list_filtered (
2122 & self ,
2223 project_id : & str ,
@@ -35,25 +36,25 @@ impl Rinth {
3536 if let Some ( featured) = featured {
3637 url = url. with_query_json ( "featured" , featured) ?;
3738 }
38- self . request . get ( url) . custom_send_json ( ) . await
39+ self . request . get ( url) . await . custom_send_json ( ) . await
3940 }
40-
41+
4142 pub async fn version_get ( & self , version_id : & str ) -> Result < Version > {
4243 check_id_slug ( & [ version_id] ) ?;
4344 self . request
4445 . get ( self . base_url . join_all ( vec ! [ "version" , version_id] ) )
45- . custom_send_json ( )
46+ . await . custom_send_json ( )
4647 . await
4748 }
48-
49+
4950 pub async fn version_get_from_number ( & self , project_id : & str , number : & str ) -> Result < Version > {
5051 check_id_slug ( & [ project_id] ) ?;
5152 self . request
5253 . get ( self . base_url . join_all ( vec ! [ "project" , project_id, "version" , number] ) )
53- . custom_send_json ( )
54+ . await . custom_send_json ( )
5455 . await
5556 }
56-
57+
5758 pub async fn version_get_multiple ( & self , version_ids : & [ & str ] ) -> Result < Vec < Version > > {
5859 check_id_slug ( version_ids) ?;
5960 self . request
@@ -62,7 +63,7 @@ impl Rinth {
6263 . join_all ( vec ! [ "versions" ] )
6364 . with_query_json ( "ids" , version_ids) ?,
6465 )
65- . custom_send_json ( )
66+ . await . custom_send_json ( )
6667 . await
6768 }
6869}
0 commit comments