Skip to content

Commit

Permalink
Update src/v2/auth.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Stefan Junker <steveeJ@users.noreply.github.com>
  • Loading branch information
jordiolivares and steveej committed Jul 16, 2020
1 parent 142b15b commit d7537e7
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/v2/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,12 @@ impl Client {
authentication_header,
)? {
WwwAuthenticateHeaderContent::Basic(_) => {
let basic_auth = {
let (user, password) =
credentials.expect("cannot authenticate without credentials");
BasicAuth {
let basic_auth = credentials
.map(|(user, password)| BasicAuth {
user,
password: Some(password),
}
};
})
.ok_or("cannot authenticate without credentials")?;

Auth::Basic(basic_auth)
}
Expand Down

0 comments on commit d7537e7

Please sign in to comment.