Skip to content

Commit dd94b48

Browse files
committed
Remove unused imports and replace expect
1 parent 73d3a82 commit dd94b48

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/client/auth/aws.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ use aws_config::BehaviorVersion;
44
#[cfg(feature = "aws-auth")]
55
use aws_credential_types::provider::ProvideCredentials;
66

7-
#[allow(unused_imports)]
8-
#[cfg(feature = "aws-auth")]
9-
use aws_types::sdk_config::SharedCredentialsProvider;
10-
117
// Note from RUST-1529: commented Duration import since original implementation is commented out
128
// use std::time::Duration;
139

@@ -123,7 +119,12 @@ async fn authenticate_stream_inner(
123119
let creds = aws_config::load_defaults(BehaviorVersion::latest())
124120
.await
125121
.credentials_provider()
126-
.expect("no credential provider configured")
122+
.ok_or_else(|| {
123+
Error::authentication_error(
124+
MECH_NAME,
125+
&format!("no credential provider configured"),
126+
)
127+
})?
127128
.provide_credentials()
128129
.await
129130
.map_err(|e| {

0 commit comments

Comments
 (0)