Skip to content

Commit bb5792b

Browse files
committed
pass by value for the pull request as well
1 parent bba8abe commit bb5792b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/client.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use std::collections::HashMap;
3131
use std::convert::TryFrom;
3232
use tokio::io::{AsyncRead, AsyncWrite, AsyncWriteExt};
3333
use tokio_util::compat::FuturesAsyncReadCompatExt;
34-
use tracing::{debug, trace, warn};
34+
use tracing::{debug, error, trace, warn};
3535

3636
const MIME_TYPES_DISTRIBUTION_MANIFEST: &[&str] = &[
3737
IMAGE_MANIFEST_MEDIA_TYPE,
@@ -281,7 +281,7 @@ impl Client {
281281
self.validate_layers(&manifest, accepted_media_types)
282282
.await?;
283283

284-
let layers = stream::iter(&manifest.layers)
284+
let layers = stream::iter(manifest.layers.clone())
285285
.map(|layer| {
286286
// This avoids moving `self` which is &mut Self
287287
// into the async block. We only want to capture
@@ -504,7 +504,10 @@ impl Client {
504504
}
505505
_ => {
506506
let reason = auth_res.text().await?;
507-
debug!("Failed to authenticate for image '{:?}': {}", image, reason);
507+
let query_str = query
508+
.iter()
509+
.fold(String::new(), |a, (k, v)| format!("{}&{}={}", a, k, v));
510+
error!(realm, query = query_str, image = ?image, reason, "Failed to authenticate for image");
508511
Err(OciDistributionError::AuthenticationFailure(reason))
509512
}
510513
}

0 commit comments

Comments
 (0)