@@ -33,7 +33,7 @@ pub async fn get_torrent_handler(
3333) -> Response {
3434 match InfoHash :: from_str ( & info_hash. 0 ) {
3535 Err ( _) => invalid_info_hash_param_response ( & info_hash. 0 ) ,
36- Ok ( info_hash) => match get_torrent_info ( & in_memory_torrent_repository, & info_hash) {
36+ Ok ( info_hash) => match get_torrent_info ( & in_memory_torrent_repository, & info_hash) . await {
3737 Some ( info) => torrent_info_response ( info) . into_response ( ) ,
3838 None => torrent_not_known_response ( ) ,
3939 } ,
@@ -85,14 +85,19 @@ pub async fn get_torrents_handler(
8585 tracing:: debug!( "pagination: {:?}" , pagination) ;
8686
8787 if pagination. 0 . info_hashes . is_empty ( ) {
88- torrent_list_response ( & get_torrents_page (
89- & in_memory_torrent_repository,
90- Some ( & Pagination :: new_with_options ( pagination. 0 . offset , pagination. 0 . limit ) ) ,
91- ) )
88+ torrent_list_response (
89+ & get_torrents_page (
90+ & in_memory_torrent_repository,
91+ Some ( & Pagination :: new_with_options ( pagination. 0 . offset , pagination. 0 . limit ) ) ,
92+ )
93+ . await ,
94+ )
9295 . into_response ( )
9396 } else {
9497 match parse_info_hashes ( pagination. 0 . info_hashes ) {
95- Ok ( info_hashes) => torrent_list_response ( & get_torrents ( & in_memory_torrent_repository, & info_hashes) ) . into_response ( ) ,
98+ Ok ( info_hashes) => {
99+ torrent_list_response ( & get_torrents ( & in_memory_torrent_repository, & info_hashes) . await ) . into_response ( )
100+ }
96101 Err ( err) => match err {
97102 QueryParamError :: InvalidInfoHash { info_hash } => invalid_info_hash_param_response ( & info_hash) ,
98103 } ,
0 commit comments