@@ -51,15 +51,19 @@ impl<'input, C, B> Parser<'input, C, B> {
5151}
5252
5353impl < ' input , B > From < & ' input str > for Parser < ' input , Nop , B > {
54- fn from ( src : & ' input str ) -> Self { Parser :: new ( src, Nop ) }
54+ fn from ( src : & ' input str ) -> Self {
55+ Parser :: new ( src, Nop )
56+ }
5557}
5658
5759impl < ' input , C : Callbacks , B : Buffers < ' input > > Iterator
5860 for Parser < ' input , C , B >
5961{
6062 type Item = Line < ' input , B > ;
6163
62- fn next ( & mut self ) -> Option < Self :: Item > { self . lines . next ( ) }
64+ fn next ( & mut self ) -> Option < Self :: Item > {
65+ self . lines . next ( )
66+ }
6367}
6468
6569#[ derive( Debug ) ]
@@ -306,32 +310,32 @@ mod tests {
306310 let src = "(this is a comment)" ;
307311 let got: Vec < _ > = parse ( src) . collect ( ) ;
308312
309- assert_eq ! ( got. len( ) , 1 ) ;
313+ pretty_assertions :: assert_eq!( got. len( ) , 1 ) ;
310314 let line = & got[ 0 ] ;
311- assert_eq ! ( line. comments( ) . len( ) , 1 ) ;
312- assert_eq ! ( line. gcodes( ) . len( ) , 0 ) ;
313- assert_eq ! ( line. span( ) , Span :: new( 0 , src. len( ) , 0 ) ) ;
315+ pretty_assertions :: assert_eq!( line. comments( ) . len( ) , 1 ) ;
316+ pretty_assertions :: assert_eq!( line. gcodes( ) . len( ) , 0 ) ;
317+ pretty_assertions :: assert_eq!( line. span( ) , Span :: new( 0 , src. len( ) , 0 ) ) ;
314318 }
315319
316320 #[ test]
317321 fn line_numbers ( ) {
318322 let src = "N42" ;
319323 let got: Vec < _ > = parse ( src) . collect ( ) ;
320324
321- assert_eq ! ( got. len( ) , 1 ) ;
325+ pretty_assertions :: assert_eq!( got. len( ) , 1 ) ;
322326 let line = & got[ 0 ] ;
323- assert_eq ! ( line. comments( ) . len( ) , 0 ) ;
324- assert_eq ! ( line. gcodes( ) . len( ) , 0 ) ;
327+ pretty_assertions :: assert_eq!( line. comments( ) . len( ) , 0 ) ;
328+ pretty_assertions :: assert_eq!( line. gcodes( ) . len( ) , 0 ) ;
325329 let span = Span :: new ( 0 , src. len ( ) , 0 ) ;
326- assert_eq ! (
330+ pretty_assertions :: assert_eq!(
327331 line. line_number( ) ,
328332 Some ( Word {
329333 letter: 'N' ,
330334 value: 42.0 ,
331335 span
332336 } )
333337 ) ;
334- assert_eq ! ( line. span( ) , span) ;
338+ pretty_assertions :: assert_eq!( line. span( ) , span) ;
335339 }
336340
337341 #[ test]
@@ -346,25 +350,25 @@ mod tests {
346350 )
347351 . collect ( ) ;
348352
349- assert_eq ! ( got. len( ) , 1 ) ;
353+ pretty_assertions :: assert_eq!( got. len( ) , 1 ) ;
350354 assert ! ( got[ 0 ] . line_number( ) . is_none( ) ) ;
351355 let unexpected_line_number = unexpected_line_number. lock ( ) . unwrap ( ) ;
352- assert_eq ! ( unexpected_line_number. len( ) , 1 ) ;
353- assert_eq ! ( unexpected_line_number[ 0 ] . 0 , 42.0 ) ;
356+ pretty_assertions :: assert_eq!( unexpected_line_number. len( ) , 1 ) ;
357+ pretty_assertions :: assert_eq!( unexpected_line_number[ 0 ] . 0 , 42.0 ) ;
354358 }
355359
356360 #[ test]
357361 fn parse_g90 ( ) {
358362 let src = "G90" ;
359363 let got: Vec < _ > = parse ( src) . collect ( ) ;
360364
361- assert_eq ! ( got. len( ) , 1 ) ;
365+ pretty_assertions :: assert_eq!( got. len( ) , 1 ) ;
362366 let line = & got[ 0 ] ;
363- assert_eq ! ( line. gcodes( ) . len( ) , 1 ) ;
367+ pretty_assertions :: assert_eq!( line. gcodes( ) . len( ) , 1 ) ;
364368 let g90 = & line. gcodes ( ) [ 0 ] ;
365- assert_eq ! ( g90. major_number( ) , 90 ) ;
366- assert_eq ! ( g90. minor_number( ) , 0 ) ;
367- assert_eq ! ( g90. arguments( ) . len( ) , 0 ) ;
369+ pretty_assertions :: assert_eq!( g90. major_number( ) , 90 ) ;
370+ pretty_assertions :: assert_eq!( g90. minor_number( ) , 0 ) ;
371+ pretty_assertions :: assert_eq!( g90. arguments( ) . len( ) , 0 ) ;
368372 }
369373
370374 #[ test]
@@ -385,11 +389,11 @@ mod tests {
385389
386390 let got: Vec < _ > = parse ( src) . collect ( ) ;
387391
388- assert_eq ! ( got. len( ) , 1 ) ;
392+ pretty_assertions :: assert_eq!( got. len( ) , 1 ) ;
389393 let line = & got[ 0 ] ;
390- assert_eq ! ( line. gcodes( ) . len( ) , 1 ) ;
394+ pretty_assertions :: assert_eq!( line. gcodes( ) . len( ) , 1 ) ;
391395 let g01 = & line. gcodes ( ) [ 0 ] ;
392- assert_eq ! ( g01, & should_be) ;
396+ pretty_assertions :: assert_eq!( g01, & should_be) ;
393397 }
394398
395399 #[ test]
@@ -398,10 +402,10 @@ mod tests {
398402
399403 let got: Vec < _ > = parse ( src) . collect ( ) ;
400404
401- assert_eq ! ( got. len( ) , 2 ) ;
402- assert_eq ! ( got[ 0 ] . gcodes( ) . len( ) , 4 ) ;
403- assert_eq ! ( got[ 0 ] . comments( ) . len( ) , 1 ) ;
404- assert_eq ! ( got[ 1 ] . gcodes( ) . len( ) , 1 ) ;
405+ pretty_assertions :: assert_eq!( got. len( ) , 2 ) ;
406+ pretty_assertions :: assert_eq!( got[ 0 ] . gcodes( ) . len( ) , 4 ) ;
407+ pretty_assertions :: assert_eq!( got[ 0 ] . comments( ) . len( ) , 1 ) ;
408+ pretty_assertions :: assert_eq!( got[ 1 ] . gcodes( ) . len( ) , 1 ) ;
405409 }
406410
407411 /// I wasn't sure if the `#[derive(Serialize)]` would work given we use
@@ -434,6 +438,6 @@ mod tests {
434438
435439 let got: Vec < _ > = crate :: parse ( src) . collect ( ) ;
436440
437- assert_eq ! ( got, expected) ;
441+ pretty_assertions :: assert_eq!( got, expected) ;
438442 }
439443}
0 commit comments