File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change 11use crate :: dialoguer;
2- use anyhow:: { anyhow, Context } ;
2+ use anyhow:: anyhow;
33use crates_io:: storage:: Storage ;
44use crates_io:: tasks:: spawn_blocking;
55use crates_io_index:: { Repository , RepositoryConfig } ;
66use indicatif:: { ProgressBar , ProgressIterator , ProgressStyle } ;
7+ use tokio:: runtime:: Handle ;
78
89#[ derive( clap:: Parser , Debug ) ]
910#[ command(
@@ -31,11 +32,6 @@ pub async fn run(opts: Opts) -> anyhow::Result<()> {
3132 return Ok ( ( ) ) ;
3233 }
3334
34- let rt = tokio:: runtime:: Builder :: new_current_thread ( )
35- . enable_all ( )
36- . build ( )
37- . context ( "Failed to initialize tokio runtime" ) ?;
38-
3935 let pb = ProgressBar :: new ( files. len ( ) as u64 ) ;
4036 pb. set_style ( ProgressStyle :: with_template (
4137 "{bar:60} ({pos}/{len}, ETA {eta})" ,
@@ -59,7 +55,7 @@ pub async fn run(opts: Opts) -> anyhow::Result<()> {
5955 }
6056
6157 let contents = std:: fs:: read_to_string ( & path) ?;
62- rt . block_on ( storage. sync_index ( crate_name, Some ( contents) ) ) ?;
58+ Handle :: current ( ) . block_on ( storage. sync_index ( crate_name, Some ( contents) ) ) ?;
6359 }
6460
6561 println ! (
You can’t perform that action at this time.
0 commit comments