File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -126,13 +126,14 @@ impl<'a> DownloadCfg<'a> {
126
126
Ok ( ( ) )
127
127
}
128
128
129
- fn download_hash ( & self , url : & str ) -> Result < String > {
129
+ async fn download_hash ( & self , url : & str ) -> Result < String > {
130
130
let hash_url = utils:: parse_url ( & ( url. to_owned ( ) + ".sha256" ) ) ?;
131
131
let hash_file = self . tmp_cx . new_file ( ) ?;
132
132
133
- utils:: run_future ( utils :: download_file ( & hash_url, & hash_file, None , & |n| {
133
+ utils:: download_file ( & hash_url, & hash_file, None , & |n| {
134
134
( self . notify_handler ) ( n. into ( ) )
135
- } ) ) ?;
135
+ } )
136
+ . await ?;
136
137
137
138
utils:: read_file ( "hash" , & hash_file) . map ( |s| s[ 0 ..64 ] . to_owned ( ) )
138
139
}
@@ -148,7 +149,7 @@ impl<'a> DownloadCfg<'a> {
148
149
update_hash : Option < & Path > ,
149
150
ext : & str ,
150
151
) -> Result < Option < ( temp:: File < ' a > , String ) > > {
151
- let hash = self . download_hash ( url_str) ?;
152
+ let hash = utils :: run_future ( self . download_hash ( url_str) ) ?;
152
153
let partial_hash: String = hash. chars ( ) . take ( UPDATE_HASH_LEN ) . collect ( ) ;
153
154
154
155
if let Some ( hash_file) = update_hash {
You can’t perform that action at this time.
0 commit comments