Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
naosense committed Apr 23, 2024
1 parent 06bec65 commit 533d7b6
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions crates/uv-auth/src/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,20 +319,16 @@ impl AuthMiddleware {
// implementation returns different credentials for different URLs in the
// same realm we will use the wrong credentials.
} else if let Some(credentials) = match self.keyring {
Some(ref keyring) => {
match credentials
.and_then(|credentials| credentials.username())
{
Some(username) => {
debug!("Checking keyring for credentials for {username}@{url}");
keyring.fetch(url, username).await
}
None => {
trace!("Skipping keyring lookup for {url} with no username");
None
}
Some(ref keyring) => match credentials.and_then(|credentials| credentials.username()) {
Some(username) => {
debug!("Checking keyring for credentials for {username}@{url}");
keyring.fetch(url, username).await
}
}
None => {
trace!("Skipping keyring lookup for {url} with no username");
None
}
},
None => None,
} {
debug!("Found credentials in keyring for {url}");
Expand Down

0 comments on commit 533d7b6

Please sign in to comment.