@@ -6,10 +6,10 @@ use std::ops::Not;
66use std:: path:: Path ;
77
88use anyhow:: { Context , Result } ;
9- use oci_client:: Client ;
109use oci_client:: secrets:: RegistryAuth ;
11- use serde_json :: Value as JsonValue ;
10+ use oci_client :: Client ;
1211use serde:: { Deserialize , Serialize } ;
12+ use serde_json:: Value as JsonValue ;
1313
1414use crate :: oci_ref:: OciReference ;
1515
@@ -416,7 +416,9 @@ pub async fn pull_devcontainer_index<P: AsRef<Path>>(filename: P) -> Result<()>
416416
417417 let image: OciReference = "ghcr.io/devcontainers/index:latest" . parse ( ) ?;
418418 let accepted_media_types = vec ! [ "application/vnd.devcontainers.index.layer.v1+json" ] ;
419- let blob = get_layer_bytes ( & image, accepted_media_types) . await . context ( "Failed to pull devcontainer index" ) ?;
419+ let blob = get_layer_bytes ( & image, accepted_media_types)
420+ . await
421+ . context ( "Failed to pull devcontainer index" ) ?;
420422 let mut file = File :: create ( filename) ?;
421423
422424 file. write_all ( & blob[ ..] ) ?;
@@ -431,7 +433,9 @@ pub async fn pull_archive_bytes(image: &OciReference) -> Result<Vec<u8>> {
431433 log:: debug!( "pull_archive_bytes" ) ;
432434
433435 let accepted_media_types = vec ! [ "application/vnd.devcontainers.layer.v1+tar" ] ;
434- let blob = get_layer_bytes ( image, accepted_media_types) . await . context ( "Failed to pull archive bytes" ) ?;
436+ let blob = get_layer_bytes ( image, accepted_media_types)
437+ . await
438+ . context ( "Failed to pull archive bytes" ) ?;
435439
436440 log:: debug!( "pull_archive_bytes: Pulled {} bytes for {}" , blob. len( ) , & image. 0 ) ;
437441
@@ -441,7 +445,10 @@ pub async fn pull_archive_bytes(image: &OciReference) -> Result<Vec<u8>> {
441445async fn get_layer_bytes ( OciReference ( image) : & OciReference , accepted_media_types : Vec < & str > ) -> Result < Vec < u8 > > {
442446 let auth = RegistryAuth :: Anonymous ;
443447 let client = Client :: new ( Default :: default ( ) ) ;
444- let image_data = client. pull ( image, & auth, accepted_media_types) . await . context ( "Failed to pull image data" ) ?;
448+ let image_data = client
449+ . pull ( image, & auth, accepted_media_types)
450+ . await
451+ . context ( "Failed to pull image data" ) ?;
445452 let blob = image_data
446453 . layers
447454 . into_iter ( )
0 commit comments