@@ -39,7 +39,7 @@ impl<'a> Iterator for CursorLines<'a> {
39
39
ret
40
40
} )
41
41
. or_else ( || {
42
- let ret = Some ( ( & self . 0 [ .. ] , EndLine :: EOF ) ) ;
42
+ let ret = Some ( ( self . 0 , EndLine :: EOF ) ) ;
43
43
self . 0 = "" ;
44
44
ret
45
45
} )
@@ -79,7 +79,7 @@ fn format_title(annotation: snippet::Annotation<'_>) -> DisplayLine<'_> {
79
79
annotation : Annotation {
80
80
annotation_type : DisplayAnnotationType :: from ( annotation. annotation_type ) ,
81
81
id : annotation. id ,
82
- label : format_label ( Some ( & label) , Some ( DisplayTextStyle :: Emphasis ) ) ,
82
+ label : format_label ( Some ( label) , Some ( DisplayTextStyle :: Emphasis ) ) ,
83
83
} ,
84
84
source_aligned : false ,
85
85
continuation : false ,
@@ -182,7 +182,7 @@ fn fold_body(mut body: Vec<DisplayLine<'_>>) -> Vec<DisplayLine<'_>> {
182
182
enum Line {
183
183
Fold ( usize ) ,
184
184
Source ( usize ) ,
185
- } ;
185
+ }
186
186
187
187
let mut lines = vec ! [ ] ;
188
188
let mut no_annotation_lines_counter = 0 ;
@@ -193,8 +193,8 @@ fn fold_body(mut body: Vec<DisplayLine<'_>>) -> Vec<DisplayLine<'_>> {
193
193
line : DisplaySourceLine :: Annotation { .. } ,
194
194
..
195
195
} => {
196
+ let fold_start = idx - no_annotation_lines_counter;
196
197
if no_annotation_lines_counter > 2 {
197
- let fold_start = idx - no_annotation_lines_counter;
198
198
let fold_end = idx;
199
199
let pre_len = if no_annotation_lines_counter > 8 {
200
200
4
@@ -224,8 +224,7 @@ fn fold_body(mut body: Vec<DisplayLine<'_>>) -> Vec<DisplayLine<'_>> {
224
224
lines. push ( Line :: Source ( i) ) ;
225
225
}
226
226
} 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) {
229
228
lines. push ( Line :: Source ( i) ) ;
230
229
}
231
230
}
@@ -377,7 +376,7 @@ fn format_body(
377
376
annotation : Annotation {
378
377
annotation_type,
379
378
id : None ,
380
- label : format_label ( Some ( & annotation. label ) , None ) ,
379
+ label : format_label ( Some ( annotation. label ) , None ) ,
381
380
} ,
382
381
range,
383
382
annotation_type : DisplayAnnotationType :: from (
@@ -490,7 +489,7 @@ fn format_body(
490
489
annotation : Annotation {
491
490
annotation_type,
492
491
id : None ,
493
- label : format_label ( Some ( & annotation. label ) , None ) ,
492
+ label : format_label ( Some ( annotation. label ) , None ) ,
494
493
} ,
495
494
range,
496
495
annotation_type : DisplayAnnotationType :: from (
0 commit comments