@@ -289,7 +289,7 @@ impl Client {
289
289
/// The client will check if it's already been authenticated and if
290
290
/// not will attempt to do.
291
291
pub async fn list_tags (
292
- & mut self ,
292
+ & self ,
293
293
image : & Reference ,
294
294
auth : & RegistryAuth ,
295
295
n : Option < usize > ,
@@ -336,7 +336,7 @@ impl Client {
336
336
/// The client will check if it's already been authenticated and if
337
337
/// not will attempt to do.
338
338
pub async fn pull (
339
- & mut self ,
339
+ & self ,
340
340
image : & Reference ,
341
341
auth : & RegistryAuth ,
342
342
accepted_media_types : Vec < & str > ,
@@ -354,7 +354,7 @@ impl Client {
354
354
355
355
let layers = stream:: iter ( & manifest. layers )
356
356
. map ( |layer| {
357
- // This avoids moving `self` which is &mut Self
357
+ // This avoids moving `self` which is &Self
358
358
// into the async block. We only want to capture
359
359
// as &Self
360
360
let this = & self ;
@@ -392,7 +392,7 @@ impl Client {
392
392
///
393
393
/// Returns pullable URL for the image
394
394
pub async fn push (
395
- & mut self ,
395
+ & self ,
396
396
image_ref : & Reference ,
397
397
layers : & [ ImageLayer ] ,
398
398
config : Config ,
@@ -413,7 +413,7 @@ impl Client {
413
413
// Upload layers
414
414
stream:: iter ( layers)
415
415
. map ( |layer| {
416
- // This avoids moving `self` which is &mut Self
416
+ // This avoids moving `self` which is &Self
417
417
// into the async block. We only want to capture
418
418
// as &Self
419
419
let this = & self ;
@@ -497,7 +497,7 @@ impl Client {
497
497
/// This performs authorization and then stores the token internally to be used
498
498
/// on other requests.
499
499
pub async fn auth (
500
- & mut self ,
500
+ & self ,
501
501
image : & Reference ,
502
502
authentication : & RegistryAuth ,
503
503
operation : RegistryOperation ,
@@ -589,7 +589,7 @@ impl Client {
589
589
/// HEAD request. If this header is not present, will make a second GET
590
590
/// request and return the SHA256 of the response body.
591
591
pub async fn fetch_manifest_digest (
592
- & mut self ,
592
+ & self ,
593
593
image : & Reference ,
594
594
auth : & RegistryAuth ,
595
595
) -> Result < String > {
@@ -666,7 +666,7 @@ impl Client {
666
666
/// If a multi-platform Image Index manifest is encountered, a platform-specific
667
667
/// Image manifest will be selected using the client's default platform resolution.
668
668
pub async fn pull_image_manifest (
669
- & mut self ,
669
+ & self ,
670
670
image : & Reference ,
671
671
auth : & RegistryAuth ,
672
672
) -> Result < ( OciImageManifest , String ) > {
@@ -686,7 +686,7 @@ impl Client {
686
686
/// A Tuple is returned containing the [Manifest](crate::manifest::OciImageManifest)
687
687
/// and the manifest content digest hash.
688
688
pub async fn pull_manifest (
689
- & mut self ,
689
+ & self ,
690
690
image : & Reference ,
691
691
auth : & RegistryAuth ,
692
692
) -> Result < ( OciManifest , String ) > {
@@ -807,7 +807,7 @@ impl Client {
807
807
/// the manifest content digest hash and the contents of the manifests config layer
808
808
/// as a String.
809
809
pub async fn pull_manifest_and_config (
810
- & mut self ,
810
+ & self ,
811
811
image : & Reference ,
812
812
auth : & RegistryAuth ,
813
813
) -> Result < ( OciImageManifest , String , String ) > {
@@ -833,7 +833,7 @@ impl Client {
833
833
}
834
834
835
835
async fn _pull_manifest_and_config (
836
- & mut self ,
836
+ & self ,
837
837
image : & Reference ,
838
838
) -> Result < ( OciImageManifest , String , Config ) > {
839
839
let ( manifest, digest) = self . _pull_image_manifest ( image) . await ?;
@@ -851,7 +851,7 @@ impl Client {
851
851
///
852
852
/// This pushes a manifest list to an OCI registry.
853
853
pub async fn push_manifest_list (
854
- & mut self ,
854
+ & self ,
855
855
reference : & Reference ,
856
856
auth : & RegistryAuth ,
857
857
manifest : OciImageIndex ,
@@ -1740,7 +1740,7 @@ mod test {
1740
1740
use hmac:: { Hmac , Mac } ;
1741
1741
use jwt:: SignWithKey ;
1742
1742
use sha2:: Sha256 ;
1743
- let mut client = Client :: default ( ) ;
1743
+ let client = Client :: default ( ) ;
1744
1744
let header = jwt:: header:: Header {
1745
1745
algorithm : jwt:: algorithm:: AlgorithmType :: Hs256 ,
1746
1746
key_id : None ,
@@ -2052,7 +2052,7 @@ mod test {
2052
2052
async fn test_auth ( ) {
2053
2053
for & image in TEST_IMAGES {
2054
2054
let reference = Reference :: try_from ( image) . expect ( "failed to parse reference" ) ;
2055
- let mut c = Client :: default ( ) ;
2055
+ let c = Client :: default ( ) ;
2056
2056
let token = c
2057
2057
. auth (
2058
2058
& reference,
@@ -2088,7 +2088,7 @@ mod test {
2088
2088
let auth =
2089
2089
RegistryAuth :: Basic ( HTPASSWD_USERNAME . to_string ( ) , HTPASSWD_PASSWORD . to_string ( ) ) ;
2090
2090
2091
- let mut client = Client :: new ( ClientConfig {
2091
+ let client = Client :: new ( ClientConfig {
2092
2092
protocol : ClientProtocol :: HttpsExcept ( vec ! [ format!( "localhost:{}" , port) ] ) ,
2093
2093
..Default :: default ( )
2094
2094
} ) ;
@@ -2150,7 +2150,7 @@ mod test {
2150
2150
. expect_err ( "pull manifest should fail" ) ;
2151
2151
2152
2152
// But this should pass
2153
- let mut c = Client :: default ( ) ;
2153
+ let c = Client :: default ( ) ;
2154
2154
c. auth (
2155
2155
& reference,
2156
2156
& RegistryAuth :: Anonymous ,
@@ -2173,7 +2173,7 @@ mod test {
2173
2173
async fn test_pull_manifest_public ( ) {
2174
2174
for & image in TEST_IMAGES {
2175
2175
let reference = Reference :: try_from ( image) . expect ( "failed to parse reference" ) ;
2176
- let mut c = Client :: default ( ) ;
2176
+ let c = Client :: default ( ) ;
2177
2177
let ( manifest, _) = c
2178
2178
. pull_image_manifest ( & reference, & RegistryAuth :: Anonymous )
2179
2179
. await
@@ -2189,7 +2189,7 @@ mod test {
2189
2189
async fn pull_manifest_and_config_public ( ) {
2190
2190
for & image in TEST_IMAGES {
2191
2191
let reference = Reference :: try_from ( image) . expect ( "failed to parse reference" ) ;
2192
- let mut c = Client :: default ( ) ;
2192
+ let c = Client :: default ( ) ;
2193
2193
let ( manifest, _, config) = c
2194
2194
. pull_manifest_and_config ( & reference, & RegistryAuth :: Anonymous )
2195
2195
. await
@@ -2204,7 +2204,7 @@ mod test {
2204
2204
2205
2205
#[ tokio:: test]
2206
2206
async fn test_fetch_digest ( ) {
2207
- let mut c = Client :: default ( ) ;
2207
+ let c = Client :: default ( ) ;
2208
2208
2209
2209
for & image in TEST_IMAGES {
2210
2210
let reference = Reference :: try_from ( image) . expect ( "failed to parse reference" ) ;
@@ -2214,7 +2214,7 @@ mod test {
2214
2214
2215
2215
// This should pass
2216
2216
let reference = Reference :: try_from ( image) . expect ( "failed to parse reference" ) ;
2217
- let mut c = Client :: default ( ) ;
2217
+ let c = Client :: default ( ) ;
2218
2218
c. auth (
2219
2219
& reference,
2220
2220
& RegistryAuth :: Anonymous ,
@@ -2236,7 +2236,7 @@ mod test {
2236
2236
2237
2237
#[ tokio:: test]
2238
2238
async fn test_pull_blob ( ) {
2239
- let mut c = Client :: default ( ) ;
2239
+ let c = Client :: default ( ) ;
2240
2240
2241
2241
for & image in TEST_IMAGES {
2242
2242
let reference = Reference :: try_from ( image) . expect ( "failed to parse reference" ) ;
@@ -2283,7 +2283,7 @@ mod test {
2283
2283
2284
2284
#[ tokio:: test]
2285
2285
async fn test_pull_blob_stream ( ) {
2286
- let mut c = Client :: default ( ) ;
2286
+ let c = Client :: default ( ) ;
2287
2287
2288
2288
for & image in TEST_IMAGES {
2289
2289
let reference = Reference :: try_from ( image) . expect ( "failed to parse reference" ) ;
@@ -2419,7 +2419,7 @@ mod test {
2419
2419
let test_container = docker. run ( registry_image ( ) ) ;
2420
2420
let port = test_container. get_host_port_ipv4 ( 5000 ) ;
2421
2421
2422
- let mut c = Client :: new ( ClientConfig {
2422
+ let c = Client :: new ( ClientConfig {
2423
2423
protocol : ClientProtocol :: Http ,
2424
2424
..Default :: default ( )
2425
2425
} ) ;
@@ -2534,7 +2534,7 @@ mod test {
2534
2534
let _ = tracing_subscriber:: fmt:: try_init ( ) ;
2535
2535
let port = test_container. get_host_port_ipv4 ( 5000 ) ;
2536
2536
2537
- let mut c = Client :: new ( ClientConfig {
2537
+ let c = Client :: new ( ClientConfig {
2538
2538
protocol : ClientProtocol :: HttpsExcept ( vec ! [ format!( "localhost:{}" , port) ] ) ,
2539
2539
..Default :: default ( )
2540
2540
} ) ;
@@ -2641,7 +2641,7 @@ mod test {
2641
2641
async fn test_platform_resolution ( ) {
2642
2642
// test that we get an error when we pull a manifest list
2643
2643
let reference = Reference :: try_from ( DOCKER_IO_IMAGE ) . expect ( "failed to parse reference" ) ;
2644
- let mut c = Client :: new ( ClientConfig {
2644
+ let c = Client :: new ( ClientConfig {
2645
2645
platform_resolver : None ,
2646
2646
..Default :: default ( )
2647
2647
} ) ;
@@ -2671,7 +2671,7 @@ mod test {
2671
2671
#[ tokio:: test]
2672
2672
async fn test_pull_ghcr_io ( ) {
2673
2673
let reference = Reference :: try_from ( GHCR_IO_IMAGE ) . expect ( "failed to parse reference" ) ;
2674
- let mut c = Client :: default ( ) ;
2674
+ let c = Client :: default ( ) ;
2675
2675
let ( manifest, _manifest_str) = c
2676
2676
. pull_image_manifest ( & reference, & RegistryAuth :: Anonymous )
2677
2677
. await
@@ -2683,7 +2683,7 @@ mod test {
2683
2683
#[ ignore]
2684
2684
async fn test_roundtrip_multiple_layers ( ) {
2685
2685
let _ = tracing_subscriber:: fmt:: try_init ( ) ;
2686
- let mut c = Client :: new ( ClientConfig {
2686
+ let c = Client :: new ( ClientConfig {
2687
2687
protocol : ClientProtocol :: HttpsExcept ( vec ! [ "oci.registry.local" . to_string( ) ] ) ,
2688
2688
..Default :: default ( )
2689
2689
} ) ;
0 commit comments