@@ -39,7 +39,7 @@ impl<'a> Iterator for CursorLines<'a> {
3939 ret
4040 } )
4141 . or_else ( || {
42- let ret = Some ( ( & self . 0 [ .. ] , EndLine :: EOF ) ) ;
42+ let ret = Some ( ( self . 0 , EndLine :: EOF ) ) ;
4343 self . 0 = "" ;
4444 ret
4545 } )
@@ -79,7 +79,7 @@ fn format_title(annotation: snippet::Annotation<'_>) -> DisplayLine<'_> {
7979 annotation : Annotation {
8080 annotation_type : DisplayAnnotationType :: from ( annotation. annotation_type ) ,
8181 id : annotation. id ,
82- label : format_label ( Some ( & label) , Some ( DisplayTextStyle :: Emphasis ) ) ,
82+ label : format_label ( Some ( label) , Some ( DisplayTextStyle :: Emphasis ) ) ,
8383 } ,
8484 source_aligned : false ,
8585 continuation : false ,
@@ -182,7 +182,7 @@ fn fold_body(mut body: Vec<DisplayLine<'_>>) -> Vec<DisplayLine<'_>> {
182182 enum Line {
183183 Fold ( usize ) ,
184184 Source ( usize ) ,
185- } ;
185+ }
186186
187187 let mut lines = vec ! [ ] ;
188188 let mut no_annotation_lines_counter = 0 ;
@@ -193,8 +193,8 @@ fn fold_body(mut body: Vec<DisplayLine<'_>>) -> Vec<DisplayLine<'_>> {
193193 line : DisplaySourceLine :: Annotation { .. } ,
194194 ..
195195 } => {
196+ let fold_start = idx - no_annotation_lines_counter;
196197 if no_annotation_lines_counter > 2 {
197- let fold_start = idx - no_annotation_lines_counter;
198198 let fold_end = idx;
199199 let pre_len = if no_annotation_lines_counter > 8 {
200200 4
@@ -224,8 +224,7 @@ fn fold_body(mut body: Vec<DisplayLine<'_>>) -> Vec<DisplayLine<'_>> {
224224 lines. push ( Line :: Source ( i) ) ;
225225 }
226226 } else {
227- let start = idx - no_annotation_lines_counter;
228- for ( i, _) in body. iter ( ) . enumerate ( ) . take ( idx) . skip ( start) {
227+ for ( i, _) in body. iter ( ) . enumerate ( ) . take ( idx) . skip ( fold_start) {
229228 lines. push ( Line :: Source ( i) ) ;
230229 }
231230 }
@@ -377,7 +376,7 @@ fn format_body(
377376 annotation : Annotation {
378377 annotation_type,
379378 id : None ,
380- label : format_label ( Some ( & annotation. label ) , None ) ,
379+ label : format_label ( Some ( annotation. label ) , None ) ,
381380 } ,
382381 range,
383382 annotation_type : DisplayAnnotationType :: from (
@@ -490,7 +489,7 @@ fn format_body(
490489 annotation : Annotation {
491490 annotation_type,
492491 id : None ,
493- label : format_label ( Some ( & annotation. label ) , None ) ,
492+ label : format_label ( Some ( annotation. label ) , None ) ,
494493 } ,
495494 range,
496495 annotation_type : DisplayAnnotationType :: from (
0 commit comments