@@ -160,7 +160,7 @@ pub struct AmazonS3Builder {
160
160
/// Copy if not exists
161
161
copy_if_not_exists : Option < ConfigValue < S3CopyIfNotExists > > ,
162
162
/// Put precondition
163
- conditional_put : Option < ConfigValue < S3ConditionalPut > > ,
163
+ conditional_put : ConfigValue < S3ConditionalPut > ,
164
164
/// Ignore tags
165
165
disable_tagging : ConfigValue < bool > ,
166
166
/// Encryption (See [`S3EncryptionConfigKey`])
@@ -523,7 +523,7 @@ impl AmazonS3Builder {
523
523
self . copy_if_not_exists = Some ( ConfigValue :: Deferred ( value. into ( ) ) )
524
524
}
525
525
AmazonS3ConfigKey :: ConditionalPut => {
526
- self . conditional_put = Some ( ConfigValue :: Deferred ( value. into ( ) ) )
526
+ self . conditional_put = ConfigValue :: Deferred ( value. into ( ) )
527
527
}
528
528
AmazonS3ConfigKey :: RequestPayer => {
529
529
self . request_payer = ConfigValue :: Deferred ( value. into ( ) )
@@ -581,9 +581,7 @@ impl AmazonS3Builder {
581
581
AmazonS3ConfigKey :: CopyIfNotExists => {
582
582
self . copy_if_not_exists . as_ref ( ) . map ( ToString :: to_string)
583
583
}
584
- AmazonS3ConfigKey :: ConditionalPut => {
585
- self . conditional_put . as_ref ( ) . map ( ToString :: to_string)
586
- }
584
+ AmazonS3ConfigKey :: ConditionalPut => Some ( self . conditional_put . to_string ( ) ) ,
587
585
AmazonS3ConfigKey :: DisableTagging => Some ( self . disable_tagging . to_string ( ) ) ,
588
586
AmazonS3ConfigKey :: RequestPayer => Some ( self . request_payer . to_string ( ) ) ,
589
587
AmazonS3ConfigKey :: Encryption ( key) => match key {
@@ -827,7 +825,7 @@ impl AmazonS3Builder {
827
825
828
826
/// Configure how to provide conditional put operations
829
827
pub fn with_conditional_put ( mut self , config : S3ConditionalPut ) -> Self {
830
- self . conditional_put = Some ( config. into ( ) ) ;
828
+ self . conditional_put = config. into ( ) ;
831
829
self
832
830
}
833
831
@@ -893,7 +891,6 @@ impl AmazonS3Builder {
893
891
let region = self . region . unwrap_or_else ( || "us-east-1" . to_string ( ) ) ;
894
892
let checksum = self . checksum_algorithm . map ( |x| x. get ( ) ) . transpose ( ) ?;
895
893
let copy_if_not_exists = self . copy_if_not_exists . map ( |x| x. get ( ) ) . transpose ( ) ?;
896
- let put_precondition = self . conditional_put . map ( |x| x. get ( ) ) . transpose ( ) ?;
897
894
898
895
let credentials = if let Some ( credentials) = self . credentials {
899
896
credentials
@@ -1034,7 +1031,7 @@ impl AmazonS3Builder {
1034
1031
disable_tagging : self . disable_tagging . get ( ) ?,
1035
1032
checksum,
1036
1033
copy_if_not_exists,
1037
- conditional_put : put_precondition ,
1034
+ conditional_put : self . conditional_put . get ( ) ? ,
1038
1035
encryption_headers,
1039
1036
request_payer : self . request_payer . get ( ) ?,
1040
1037
} ;
0 commit comments