@@ -253,23 +253,27 @@ impl Storage {
253
253
#[ instrument( skip( self , bytes) ) ]
254
254
pub async fn upload_crate_file ( & self , name : & str , version : & str , bytes : Bytes ) -> Result < ( ) > {
255
255
let path = crate_file_path ( name, version) ;
256
- self . crate_upload_store . put ( & path, bytes) . await
256
+ self . crate_upload_store . put ( & path, bytes) . await ?;
257
+ Ok ( ( ) )
257
258
}
258
259
259
260
#[ instrument( skip( self , bytes) ) ]
260
261
pub async fn upload_readme ( & self , name : & str , version : & str , bytes : Bytes ) -> Result < ( ) > {
261
262
let path = readme_path ( name, version) ;
262
- self . readme_upload_store . put ( & path, bytes) . await
263
+ self . readme_upload_store . put ( & path, bytes) . await ?;
264
+ Ok ( ( ) )
263
265
}
264
266
265
267
#[ instrument( skip( self , content) ) ]
266
268
pub async fn sync_index ( & self , name : & str , content : Option < String > ) -> Result < ( ) > {
267
269
let path = crates_io_index:: Repository :: relative_index_file_for_url ( name) . into ( ) ;
268
270
if let Some ( content) = content {
269
- self . index_upload_store . put ( & path, content. into ( ) ) . await
271
+ self . index_upload_store . put ( & path, content. into ( ) ) . await ? ;
270
272
} else {
271
- self . index_store . delete ( & path) . await
273
+ self . index_store . delete ( & path) . await ? ;
272
274
}
275
+
276
+ Ok ( ( ) )
273
277
}
274
278
275
279
#[ instrument( skip( self ) ) ]
@@ -302,7 +306,7 @@ impl Storage {
302
306
}
303
307
304
308
async fn delete_all_with_prefix ( & self , prefix : & Path ) -> Result < ( ) > {
305
- let objects = self . store . list ( Some ( prefix) ) . await ? ;
309
+ let objects = self . store . list ( Some ( prefix) ) ;
306
310
let locations = objects. map ( |meta| meta. map ( |m| m. location ) ) . boxed ( ) ;
307
311
308
312
self . store
@@ -378,7 +382,7 @@ mod tests {
378
382
}
379
383
380
384
pub async fn stored_files ( store : & dyn ObjectStore ) -> Vec < String > {
381
- let stream = store. list ( None ) . await . unwrap ( ) ;
385
+ let stream = store. list ( None ) ;
382
386
let list = stream. try_collect :: < Vec < _ > > ( ) . await . unwrap ( ) ;
383
387
384
388
list. into_iter ( )
0 commit comments