@@ -162,7 +162,7 @@ mod tests {
162162
163163 #[ test]
164164 fn parses_dependencies ( ) {
165- [
165+ for ( input , expected_path , expected_tag , expected_alias ) in [
166166 ( "gakonst/lootloose" , "https://github.com/gakonst/lootloose" , None , None ) ,
167167 ( "github.com/gakonst/lootloose" , "https://github.com/gakonst/lootloose" , None , None ) ,
168168 (
@@ -239,15 +239,13 @@ mod tests {
239239 Some ( "v1" ) ,
240240 Some ( "loot" ) ,
241241 ) ,
242- ]
243- . iter ( )
244- . for_each ( |( input, expected_path, expected_tag, expected_alias) | {
242+ ] {
245243 let dep = Dependency :: from_str ( input) . unwrap ( ) ;
246244 assert_eq ! ( dep. url, Some ( expected_path. to_string( ) ) ) ;
247245 assert_eq ! ( dep. tag, expected_tag. map( ToString :: to_string) ) ;
248246 assert_eq ! ( dep. name, "lootloose" ) ;
249247 assert_eq ! ( dep. alias, expected_alias. map( ToString :: to_string) ) ;
250- } ) ;
248+ }
251249 }
252250
253251 #[ test]
@@ -267,28 +265,26 @@ mod tests {
267265
268266 #[ test]
269267 fn parses_contract_info ( ) {
270- [
268+ for ( input , expected_path , expected_name ) in [
271269 (
272270 "src/contracts/Contracts.sol:Contract" ,
273271 Some ( "src/contracts/Contracts.sol" ) ,
274272 "Contract" ,
275273 ) ,
276274 ( "Contract" , None , "Contract" ) ,
277- ]
278- . iter ( )
279- . for_each ( |( input, expected_path, expected_name) | {
275+ ] {
280276 let contract = ContractInfo :: from_str ( input) . unwrap ( ) ;
281277 assert_eq ! ( contract. path, expected_path. map( ToString :: to_string) ) ;
282278 assert_eq ! ( contract. name, expected_name. to_string( ) ) ;
283- } ) ;
279+ }
284280 }
285281
286282 #[ test]
287283 fn contract_info_should_reject_without_name ( ) {
288- [ "src/contracts/" , "src/contracts/Contracts.sol" ] . iter ( ) . for_each ( |input| {
284+ for input in [ "src/contracts/" , "src/contracts/Contracts.sol" ] {
289285 let contract = ContractInfo :: from_str ( input) ;
290- assert ! ( contract. is_err( ) )
291- } ) ;
286+ assert ! ( contract. is_err( ) ) ;
287+ }
292288 }
293289
294290 #[ test]
0 commit comments