@@ -160,7 +160,7 @@ mod tests {
160
160
161
161
#[ test]
162
162
fn parses_dependencies ( ) {
163
- [
163
+ for ( input , expected_path , expected_tag , expected_alias ) in & [
164
164
( "gakonst/lootloose" , "https://github.com/gakonst/lootloose" , None , None ) ,
165
165
( "github.com/gakonst/lootloose" , "https://github.com/gakonst/lootloose" , None , None ) ,
166
166
(
@@ -242,15 +242,13 @@ mod tests {
242
242
Some ( "v1" ) ,
243
243
Some ( "loot" ) ,
244
244
) ,
245
- ]
246
- . iter ( )
247
- . for_each ( |( input, expected_path, expected_tag, expected_alias) | {
245
+ ] {
248
246
let dep = Dependency :: from_str ( input) . unwrap ( ) ;
249
247
assert_eq ! ( dep. url, Some ( expected_path. to_string( ) ) ) ;
250
248
assert_eq ! ( dep. tag, expected_tag. map( ToString :: to_string) ) ;
251
249
assert_eq ! ( dep. name, "lootloose" ) ;
252
250
assert_eq ! ( dep. alias, expected_alias. map( ToString :: to_string) ) ;
253
- } ) ;
251
+ }
254
252
}
255
253
256
254
#[ test]
@@ -270,28 +268,26 @@ mod tests {
270
268
271
269
#[ test]
272
270
fn parses_contract_info ( ) {
273
- [
271
+ for ( input , expected_path , expected_name ) in & [
274
272
(
275
273
"src/contracts/Contracts.sol:Contract" ,
276
274
Some ( "src/contracts/Contracts.sol" ) ,
277
275
"Contract" ,
278
276
) ,
279
277
( "Contract" , None , "Contract" ) ,
280
- ]
281
- . iter ( )
282
- . for_each ( |( input, expected_path, expected_name) | {
278
+ ] {
283
279
let contract = ContractInfo :: from_str ( input) . unwrap ( ) ;
284
280
assert_eq ! ( contract. path, expected_path. map( ToString :: to_string) ) ;
285
281
assert_eq ! ( contract. name, expected_name. to_string( ) ) ;
286
- } ) ;
282
+ }
287
283
}
288
284
289
285
#[ test]
290
286
fn contract_info_should_reject_without_name ( ) {
291
- [ "src/contracts/" , "src/contracts/Contracts.sol" ] . iter ( ) . for_each ( |input| {
287
+ for input in & [ "src/contracts/" , "src/contracts/Contracts.sol" ] {
292
288
let contract = ContractInfo :: from_str ( input) ;
293
289
assert ! ( contract. is_err( ) )
294
- } ) ;
290
+ }
295
291
}
296
292
297
293
#[ test]
0 commit comments