@@ -35,7 +35,7 @@ pub fn rsx_attributes<I>(input: I) -> ParseResult<RSXAttributes, I>
35
35
where
36
36
I : Stream < Item = char >
37
37
{
38
- many1 ( parser ( rsx_attribute) . skip ( parser ( js_whitespace) ) ) . map ( RSXAttributes ) . parse_stream ( input)
38
+ many1 ( parser ( rsx_attribute) . skip ( parser ( js_whitespace) ) ) . parse_stream ( input)
39
39
}
40
40
41
41
pub fn rsx_attribute < I > ( input : I ) -> ParseResult < RSXAttribute , I >
@@ -211,7 +211,7 @@ mod tests {
211
211
. 0 ;
212
212
213
213
let tokens = quote ! {
214
- RSXAttributes ( vec! [
214
+ RSXAttributes ( box [
215
215
RSXAttribute :: Named (
216
216
RSXAttributeName :: Name ( RSXIdentifier :: from( "foo" ) ) ,
217
217
RSXAttributeValue :: Default
@@ -348,34 +348,34 @@ mod tests {
348
348
RSXAttributeName :: Name ( RSXIdentifier :: from( "foo" ) ) ,
349
349
RSXAttributeValue :: Element ( RSXElement :: SelfClosing ( RSXSelfClosingElement (
350
350
RSXElementName :: Name ( RSXIdentifier :: from( "bar" ) ) ,
351
- RSXAttributes ( vec! [ ] )
351
+ RSXAttributes ( box [ ] )
352
352
) ) )
353
353
) ,
354
354
RSXAttribute :: Named (
355
355
RSXAttributeName :: Name ( RSXIdentifier :: from( "foo" ) ) ,
356
356
RSXAttributeValue :: CodeBlock ( RSXArbitraryCodeRegion :: RuntimeValue (
357
- RSXRuntimeValue ( Box :: new ( {
357
+ RSXRuntimeValue ( box {
358
358
RSXElement :: SelfClosing ( RSXSelfClosingElement (
359
359
RSXElementName :: Name ( RSXIdentifier :: from( "bar" ) ) ,
360
- RSXAttributes ( vec! [ ] )
360
+ RSXAttributes ( box [ ] )
361
361
) )
362
- } ) )
362
+ } )
363
363
) )
364
364
) ,
365
365
RSXAttribute :: Named (
366
366
RSXAttributeName :: Name ( RSXIdentifier :: from( "foo" ) ) ,
367
367
RSXAttributeValue :: CodeBlock ( RSXArbitraryCodeRegion :: RuntimeValue (
368
- RSXRuntimeValue ( Box :: new ( { 1 + 2 + 3 } ) )
368
+ RSXRuntimeValue ( box { 1 + 2 + 3 } )
369
369
) )
370
370
) ,
371
371
RSXAttribute :: Named (
372
372
RSXAttributeName :: Name ( RSXIdentifier :: from( "foo" ) ) ,
373
373
RSXAttributeValue :: CodeBlock ( RSXArbitraryCodeRegion :: RuntimeValue (
374
- RSXRuntimeValue ( Box :: new ( {
374
+ RSXRuntimeValue ( box {
375
375
{
376
376
1 + { 2 + { 3 } }
377
377
}
378
- } ) )
378
+ } )
379
379
) )
380
380
) ,
381
381
RSXAttribute :: Named (
@@ -414,31 +414,31 @@ mod tests {
414
414
assert_eq ! ( p( rsx_attributes) . parse( " " ) . is_err( ) , true ) ;
415
415
assert_eq ! (
416
416
p( rsx_attributes) . parse( "foo" ) . unwrap( ) ,
417
- ( RSXAttributes ( vec![ ( "foo" , "true" ) . into( ) ] ) , "" )
417
+ ( RSXAttributes :: from ( vec![ ( "foo" , "true" ) . into( ) ] ) , "" )
418
418
) ;
419
419
assert_eq ! (
420
420
p( rsx_attributes) . parse( "foo bar" ) . unwrap( ) ,
421
- ( RSXAttributes ( vec![ ( "foo" , "true" ) . into( ) , ( "bar" , "true" ) . into( ) ] ) , "" )
421
+ ( RSXAttributes :: from ( vec![ ( "foo" , "true" ) . into( ) , ( "bar" , "true" ) . into( ) ] ) , "" )
422
422
) ;
423
423
assert_eq ! (
424
424
p( rsx_attributes) . parse( "foo = 'bar'" ) . unwrap( ) ,
425
- ( RSXAttributes ( vec![ ( "foo" , "bar" ) . into( ) ] ) , "" )
425
+ ( RSXAttributes :: from ( vec![ ( "foo" , "bar" ) . into( ) ] ) , "" )
426
426
) ;
427
427
assert_eq ! (
428
428
p( rsx_attributes) . parse( "foo='bar' baz" ) . unwrap( ) ,
429
- ( RSXAttributes ( vec![ ( "foo" , "bar" ) . into( ) , ( "baz" , "true" ) . into( ) ] ) , "" )
429
+ ( RSXAttributes :: from ( vec![ ( "foo" , "bar" ) . into( ) , ( "baz" , "true" ) . into( ) ] ) , "" )
430
430
) ;
431
431
assert_eq ! (
432
432
p( rsx_attributes) . parse( "foo = 'bar' baz" ) . unwrap( ) ,
433
- ( RSXAttributes ( vec![ ( "foo" , "bar" ) . into( ) , ( "baz" , "true" ) . into( ) ] ) , "" )
433
+ ( RSXAttributes :: from ( vec![ ( "foo" , "bar" ) . into( ) , ( "baz" , "true" ) . into( ) ] ) , "" )
434
434
) ;
435
435
assert_eq ! (
436
436
p( rsx_attributes) . parse( "foo='bar' bar='baz'" ) . unwrap( ) ,
437
- ( RSXAttributes ( vec![ ( "foo" , "bar" ) . into( ) , ( "bar" , "baz" ) . into( ) ] ) , "" )
437
+ ( RSXAttributes :: from ( vec![ ( "foo" , "bar" ) . into( ) , ( "bar" , "baz" ) . into( ) ] ) , "" )
438
438
) ;
439
439
assert_eq ! (
440
440
p( rsx_attributes) . parse( "foo = 'bar' bar='baz'" ) . unwrap( ) ,
441
- ( RSXAttributes ( vec![ ( "foo" , "bar" ) . into( ) , ( "bar" , "baz" ) . into( ) ] ) , "" )
441
+ ( RSXAttributes :: from ( vec![ ( "foo" , "bar" ) . into( ) , ( "bar" , "baz" ) . into( ) ] ) , "" )
442
442
) ;
443
443
}
444
444
0 commit comments