@@ -313,16 +313,13 @@ mod tests {
313313 fn converts_cors_configuration_between_dto_and_core ( ) {
314314 let dto = CORSConfiguration {
315315 cors_rules : vec ! [ CORSRule {
316- allowed_headers: Some (
317- vec![ "content-type" . to_string( ) , "x-amz-meta-*" . to_string( ) ] . into( ) ,
318- ) ,
319- allowed_methods: vec![ "GET" . to_string( ) , "PUT" . to_string( ) ] . into( ) ,
320- allowed_origins: vec![ "https://example.org" . to_string( ) ] . into( ) ,
321- expose_headers: Some ( vec![ "etag" . to_string( ) ] . into( ) ) ,
316+ allowed_headers: Some ( vec![ "content-type" . to_string( ) , "x-amz-meta-*" . to_string( ) ] ) ,
317+ allowed_methods: vec![ "GET" . to_string( ) , "PUT" . to_string( ) ] ,
318+ allowed_origins: vec![ "https://example.org" . to_string( ) ] ,
319+ expose_headers: Some ( vec![ "etag" . to_string( ) ] ) ,
322320 id: Some ( "rule-1" . to_string( ) ) ,
323321 max_age_seconds: Some ( 60 ) ,
324- } ]
325- . into ( ) ,
322+ } ] ,
326323 } ;
327324
328325 let core = dto_to_bucket_cors ( dto. clone ( ) ) . unwrap ( ) ;
@@ -339,10 +336,7 @@ mod tests {
339336
340337 #[ test]
341338 fn rejects_empty_cors_configuration ( ) {
342- let err = dto_to_bucket_cors ( CORSConfiguration {
343- cors_rules : vec ! [ ] . into ( ) ,
344- } )
345- . unwrap_err ( ) ;
339+ let err = dto_to_bucket_cors ( CORSConfiguration { cors_rules : vec ! [ ] } ) . unwrap_err ( ) ;
346340 assert_eq ! ( err. code( ) , & s3s:: S3ErrorCode :: MalformedXML ) ;
347341 }
348342
@@ -351,13 +345,12 @@ mod tests {
351345 let err = dto_to_bucket_cors ( CORSConfiguration {
352346 cors_rules : vec ! [ CORSRule {
353347 allowed_headers: None ,
354- allowed_methods: vec![ ] . into ( ) ,
355- allowed_origins: vec![ ] . into ( ) ,
348+ allowed_methods: vec![ ] ,
349+ allowed_origins: vec![ ] ,
356350 expose_headers: None ,
357351 id: None ,
358352 max_age_seconds: None ,
359- } ]
360- . into ( ) ,
353+ } ] ,
361354 } )
362355 . unwrap_err ( ) ;
363356
0 commit comments