@@ -426,7 +426,7 @@ impl ImageProxy {
426
426
} ;
427
427
428
428
// Verify semantic version
429
- let protover = r. impl_request :: < String > ( "Initialize" , [ ( ) ; 0 ] ) . await ?. 0 ;
429
+ let protover: String = r. impl_request ( "Initialize" , [ ( ) ; 0 ] ) . await ?. 0 ;
430
430
tracing:: debug!( "Remote protocol version: {protover}" ) ;
431
431
let protover = semver:: Version :: parse ( protover. as_str ( ) ) ?;
432
432
// Previously we had a feature to opt-in to requiring newer versions using `if cfg!()`.
@@ -523,18 +523,14 @@ impl ImageProxy {
523
523
#[ instrument]
524
524
pub async fn open_image ( & self , imgref : & str ) -> Result < OpenedImage > {
525
525
tracing:: debug!( "opening image" ) ;
526
- let ( imgid, _) = self
527
- . impl_request :: < u32 > ( "OpenImage" , [ imgref] )
528
- . await ?;
526
+ let ( imgid, _) : ( u32 , _ ) = self . impl_request ( "OpenImage" , [ imgref] ) . await ?;
529
527
Ok ( OpenedImage ( imgid) )
530
528
}
531
529
532
530
#[ instrument]
533
531
pub async fn open_image_optional ( & self , imgref : & str ) -> Result < Option < OpenedImage > > {
534
532
tracing:: debug!( "opening image" ) ;
535
- let ( imgid, _) = self
536
- . impl_request :: < u32 > ( "OpenImageOptional" , [ imgref] )
537
- . await ?;
533
+ let ( imgid, _) : ( u32 , _ ) = self . impl_request ( "OpenImageOptional" , [ imgref] ) . await ?;
538
534
if imgid == 0 {
539
535
Ok ( None )
540
536
} else {
@@ -586,9 +582,7 @@ impl ImageProxy {
586
582
/// Fetch the config.
587
583
/// For more information on OCI config, see <https://github.com/opencontainers/image-spec/blob/main/config.md>
588
584
pub async fn fetch_config_raw ( & self , img : & OpenedImage ) -> Result < Vec < u8 > > {
589
- let ( _, fd) = self
590
- . impl_request :: < ( ) > ( "GetFullConfig" , [ img. 0 ] )
591
- . await ?;
585
+ let ( ( ) , fd) = self . impl_request ( "GetFullConfig" , [ img. 0 ] ) . await ?;
592
586
self . read_all_fd ( fd) . await
593
587
}
594
588
@@ -626,7 +620,7 @@ impl ImageProxy {
626
620
tracing:: debug!( "fetching blob" ) ;
627
621
let args: Vec < serde_json:: Value > =
628
622
vec ! [ img. 0 . into( ) , digest. to_string( ) . into( ) , size. into( ) ] ;
629
- let ( _bloblen, fd) = self . impl_request :: < i64 > ( "GetBlob" , args) . await ?;
623
+ let ( _bloblen, fd) : ( u64 , _ ) = self . impl_request ( "GetBlob" , args) . await ?;
630
624
let fd = fd. ok_or_else ( || Error :: Other ( "Missing fd from reply" . into ( ) ) ) ?;
631
625
let FileDescriptors :: FinishPipe { pipeid, datafd } = fd else {
632
626
return Err ( Error :: Other ( "got dualfds, expecting FinishPipe fd" . into ( ) ) ) ;
@@ -678,7 +672,7 @@ impl ImageProxy {
678
672
) > {
679
673
tracing:: debug!( "fetching blob" ) ;
680
674
let args: Vec < serde_json:: Value > = vec ! [ img. 0 . into( ) , digest. to_string( ) . into( ) ] ;
681
- let ( bloblen, fd) = self . impl_request :: < u64 > ( "GetRawBlob" , args) . await ?;
675
+ let ( bloblen, fd) : ( u64 , _ ) = self . impl_request ( "GetRawBlob" , args) . await ?;
682
676
let fd = fd. ok_or_else ( || Error :: new_other ( "Missing fd from reply" ) ) ?;
683
677
let FileDescriptors :: DualFds { datafd, errfd } = fd else {
684
678
return Err ( Error :: Other ( "got single fd, expecting dual fds" . into ( ) ) ) ;
@@ -710,9 +704,7 @@ impl ImageProxy {
710
704
) -> Result < Option < Vec < ConvertedLayerInfo > > > {
711
705
tracing:: debug!( "Getting layer info" ) ;
712
706
if layer_info_piped_proto_version ( ) . matches ( & self . protover ) {
713
- let ( _, fd) = self
714
- . impl_request :: < ( ) > ( "GetLayerInfoPiped" , [ img. 0 ] )
715
- . await ?;
707
+ let ( ( ) , fd) = self . impl_request ( "GetLayerInfoPiped" , [ img. 0 ] ) . await ?;
716
708
let buf = self . read_all_fd ( fd) . await ?;
717
709
return Ok ( Some ( serde_json:: from_slice ( & buf) ?) ) ;
718
710
}
0 commit comments