@@ -151,33 +151,33 @@ impl GlueCatalog {
151151 async fn new ( config : GlueCatalogConfig ) -> Result < Self > {
152152 let sdk_config = create_sdk_config ( & config. props , config. uri . as_ref ( ) ) . await ;
153153 let mut file_io_props = config. props . clone ( ) ;
154- if !file_io_props. contains_key ( S3_ACCESS_KEY_ID ) {
155- if let Some ( access_key_id) = file_io_props. get ( AWS_ACCESS_KEY_ID ) {
156- file_io_props . insert ( S3_ACCESS_KEY_ID . to_string ( ) , access_key_id . to_string ( ) ) ;
157- }
154+ if !file_io_props. contains_key ( S3_ACCESS_KEY_ID )
155+ && let Some ( access_key_id) = file_io_props. get ( AWS_ACCESS_KEY_ID )
156+ {
157+ file_io_props . insert ( S3_ACCESS_KEY_ID . to_string ( ) , access_key_id . to_string ( ) ) ;
158158 }
159- if !file_io_props. contains_key ( S3_SECRET_ACCESS_KEY ) {
160- if let Some ( secret_access_key) = file_io_props. get ( AWS_SECRET_ACCESS_KEY ) {
161- file_io_props . insert (
162- S3_SECRET_ACCESS_KEY . to_string ( ) ,
163- secret_access_key . to_string ( ) ,
164- ) ;
165- }
159+ if !file_io_props. contains_key ( S3_SECRET_ACCESS_KEY )
160+ && let Some ( secret_access_key) = file_io_props. get ( AWS_SECRET_ACCESS_KEY )
161+ {
162+ file_io_props . insert (
163+ S3_SECRET_ACCESS_KEY . to_string ( ) ,
164+ secret_access_key . to_string ( ) ,
165+ ) ;
166166 }
167- if !file_io_props. contains_key ( S3_REGION ) {
168- if let Some ( region) = file_io_props. get ( AWS_REGION_NAME ) {
169- file_io_props . insert ( S3_REGION . to_string ( ) , region . to_string ( ) ) ;
170- }
167+ if !file_io_props. contains_key ( S3_REGION )
168+ && let Some ( region) = file_io_props. get ( AWS_REGION_NAME )
169+ {
170+ file_io_props . insert ( S3_REGION . to_string ( ) , region . to_string ( ) ) ;
171171 }
172- if !file_io_props. contains_key ( S3_SESSION_TOKEN ) {
173- if let Some ( session_token) = file_io_props. get ( AWS_SESSION_TOKEN ) {
174- file_io_props . insert ( S3_SESSION_TOKEN . to_string ( ) , session_token . to_string ( ) ) ;
175- }
172+ if !file_io_props. contains_key ( S3_SESSION_TOKEN )
173+ && let Some ( session_token) = file_io_props. get ( AWS_SESSION_TOKEN )
174+ {
175+ file_io_props . insert ( S3_SESSION_TOKEN . to_string ( ) , session_token . to_string ( ) ) ;
176176 }
177- if !file_io_props. contains_key ( S3_ENDPOINT ) {
178- if let Some ( aws_endpoint) = config. uri . as_ref ( ) {
179- file_io_props . insert ( S3_ENDPOINT . to_string ( ) , aws_endpoint . to_string ( ) ) ;
180- }
177+ if !file_io_props. contains_key ( S3_ENDPOINT )
178+ && let Some ( aws_endpoint) = config. uri . as_ref ( )
179+ {
180+ file_io_props . insert ( S3_ENDPOINT . to_string ( ) , aws_endpoint . to_string ( ) ) ;
181181 }
182182
183183 let client = aws_sdk_glue:: Client :: new ( & sdk_config) ;
0 commit comments