@@ -372,7 +372,7 @@ impl<'surface, 'core> Driver<'surface, 'core> {
372372 let pos = pos. to_string ( ) ;
373373 let doc = context
374374 . concat ( [
375- context. text ( & pos) ,
375+ context. text ( pos) ,
376376 context. space ( ) ,
377377 context. text ( "=" ) ,
378378 context. space ( ) ,
@@ -427,12 +427,7 @@ impl<'surface, 'core> Driver<'surface, 'core> {
427427 match err {
428428 ReadError :: ReadFailFormat ( span) => Diagnostic :: error ( )
429429 . with_message ( err. to_string ( ) )
430- . with_labels (
431- IntoIterator :: into_iter ( [ label_for_span ( & span) ] )
432- . into_iter ( )
433- . flatten ( )
434- . collect ( ) ,
435- )
430+ . with_labels ( label_for_span ( & span) . into_iter ( ) . collect ( ) )
436431 . with_notes ( vec ! [ format!(
437432 "A fail format was encountered when reading this file."
438433 ) ] ) ,
@@ -446,12 +441,7 @@ impl<'surface, 'core> Driver<'surface, 'core> {
446441
447442 Diagnostic :: error ( )
448443 . with_message ( err. to_string ( ) )
449- . with_labels (
450- IntoIterator :: into_iter ( [ label_for_span ( & span) ] )
451- . into_iter ( )
452- . flatten ( )
453- . collect ( ) ,
454- )
444+ . with_labels ( label_for_span ( & span) . into_iter ( ) . collect ( ) )
455445 . with_notes ( vec ! [
456446 "The predicate on a conditional format did not succeed." . to_string( ) ,
457447 format!( "failed value: {}" , doc. pretty( self . emit_width) ) ,
@@ -463,12 +453,7 @@ impl<'surface, 'core> Driver<'surface, 'core> {
463453 ReadError :: BufferError ( span, err) => self . buffer_error_to_diagnostic ( err, span) ,
464454 ReadError :: InvalidFormat ( span) | ReadError :: InvalidValue ( span) => Diagnostic :: bug ( )
465455 . with_message ( format ! ( "unexpected error '{err}'" ) )
466- . with_labels (
467- IntoIterator :: into_iter ( [ label_for_span ( & span) ] )
468- . into_iter ( )
469- . flatten ( )
470- . collect ( ) ,
471- )
456+ . with_labels ( label_for_span ( & span) . into_iter ( ) . collect ( ) )
472457 . with_notes ( vec ! [ format!(
473458 "please file a bug report at: {BUG_REPORT_URL}"
474459 ) ] ) ,
@@ -484,58 +469,33 @@ impl<'surface, 'core> Driver<'surface, 'core> {
484469 match err {
485470 BufferError :: UnexpectedEndOfBuffer => Diagnostic :: error ( )
486471 . with_message ( err. to_string ( ) )
487- . with_labels (
488- IntoIterator :: into_iter ( [ label_for_span ( & span) ] )
489- . into_iter ( )
490- . flatten ( )
491- . collect ( ) ,
492- )
472+ . with_labels ( label_for_span ( & span) . into_iter ( ) . collect ( ) )
493473 . with_notes ( vec ! [ format!(
494474 "The end of the buffer was reached before all data could be read."
495475 ) ] ) ,
496476 BufferError :: SetOffsetBeforeStartOfBuffer { offset } => Diagnostic :: error ( )
497477 . with_message ( err. to_string ( ) )
498- . with_labels (
499- IntoIterator :: into_iter ( [ label_for_span ( & span) ] )
500- . into_iter ( )
501- . flatten ( )
502- . collect ( ) ,
503- )
478+ . with_labels ( label_for_span ( & span) . into_iter ( ) . collect ( ) )
504479 . with_notes ( vec ! [ format!(
505480 "The offset {offset} is before the start of the buffer."
506481 ) ] ) ,
507482 BufferError :: SetOffsetAfterEndOfBuffer {
508483 offset : Some ( offset) ,
509484 } => Diagnostic :: error ( )
510485 . with_message ( err. to_string ( ) )
511- . with_labels (
512- IntoIterator :: into_iter ( [ label_for_span ( & span) ] )
513- . into_iter ( )
514- . flatten ( )
515- . collect ( ) ,
516- )
486+ . with_labels ( label_for_span ( & span) . into_iter ( ) . collect ( ) )
517487 . with_notes ( vec ! [ format!(
518488 "The offset {offset} is beyond the end of the buffer."
519489 ) ] ) ,
520490 BufferError :: SetOffsetAfterEndOfBuffer { offset : None } => Diagnostic :: error ( )
521491 . with_message ( err. to_string ( ) )
522- . with_labels (
523- IntoIterator :: into_iter ( [ label_for_span ( & span) ] )
524- . into_iter ( )
525- . flatten ( )
526- . collect ( ) ,
527- )
492+ . with_labels ( label_for_span ( & span) . into_iter ( ) . collect ( ) )
528493 . with_notes ( vec ! [ format!(
529494 "The offset is beyond the end of the buffer (overflow)." ,
530495 ) ] ) ,
531496 BufferError :: PositionOverflow => Diagnostic :: bug ( )
532497 . with_message ( format ! ( "unexpected error '{err}'" ) )
533- . with_labels (
534- IntoIterator :: into_iter ( [ label_for_span ( & span) ] )
535- . into_iter ( )
536- . flatten ( )
537- . collect ( ) ,
538- )
498+ . with_labels ( label_for_span ( & span) . into_iter ( ) . collect ( ) )
539499 . with_notes ( vec ! [ format!(
540500 "please file a bug report at: {BUG_REPORT_URL}"
541501 ) ] ) ,
0 commit comments