@@ -102,7 +102,6 @@ pub enum RenderedLineKind {
102
102
Annotations ,
103
103
Elision ,
104
104
}
105
- use self :: RenderedLineKind as RLK ;
106
105
107
106
impl SnippetData {
108
107
pub fn new ( codemap : Rc < CodeMap > ,
@@ -243,19 +242,19 @@ impl RenderedLine {
243
242
impl RenderedLineKind {
244
243
fn prefix ( & self ) -> StyledString {
245
244
match * self {
246
- RLK :: SourceText { file : _, line_index } =>
245
+ RenderedLineKind :: SourceText { file : _, line_index } =>
247
246
StyledString {
248
247
text : format ! ( "{}" , line_index + 1 ) ,
249
248
style : Style :: LineNumber ,
250
249
} ,
251
- RLK :: Elision =>
250
+ RenderedLineKind :: Elision =>
252
251
StyledString {
253
252
text : String :: from ( "..." ) ,
254
253
style : Style :: LineNumber ,
255
254
} ,
256
- RLK :: PrimaryFileName |
257
- RLK :: OtherFileName |
258
- RLK :: Annotations =>
255
+ RenderedLineKind :: PrimaryFileName |
256
+ RenderedLineKind :: OtherFileName |
257
+ RenderedLineKind :: Annotations =>
259
258
StyledString {
260
259
text : String :: from ( "" ) ,
261
260
style : Style :: LineNumber ,
@@ -295,7 +294,7 @@ impl StyledBuffer {
295
294
//We know our first output line is source and the rest are highlights and labels
296
295
output. push ( RenderedLine { text : styled_vec, kind : source_kind. clone ( ) } ) ;
297
296
} else {
298
- output. push ( RenderedLine { text : styled_vec, kind : RLK :: Annotations } ) ;
297
+ output. push ( RenderedLine { text : styled_vec, kind : RenderedLineKind :: Annotations } ) ;
299
298
}
300
299
styled_vec = vec ! [ ] ;
301
300
}
@@ -483,7 +482,7 @@ impl FileInfo {
483
482
text: format!( ":{}:{}" , lo. line, lo. col. 0 + 1 ) ,
484
483
style: Style :: LineAndColumn ,
485
484
} ] ,
486
- kind : RLK :: PrimaryFileName ,
485
+ kind : RenderedLineKind :: PrimaryFileName ,
487
486
} ) ;
488
487
}
489
488
None => {
@@ -492,7 +491,7 @@ impl FileInfo {
492
491
text: self . file. name. clone( ) ,
493
492
style: Style :: FileNameStyle ,
494
493
} ] ,
495
- kind : RLK :: OtherFileName ,
494
+ kind : RenderedLineKind :: OtherFileName ,
496
495
} ) ;
497
496
}
498
497
}
@@ -533,7 +532,8 @@ impl FileInfo {
533
532
if prev_ends_at_eol && is_single_unlabeled_annotated_line {
534
533
if !elide_unlabeled_region {
535
534
output. push ( RenderedLine :: from ( ( String :: new ( ) ,
536
- Style :: NoStyle , RLK :: Elision ) ) ) ;
535
+ Style :: NoStyle ,
536
+ RenderedLineKind :: Elision ) ) ) ;
537
537
elide_unlabeled_region = true ;
538
538
prev_ends_at_eol = true ;
539
539
}
@@ -547,7 +547,9 @@ impl FileInfo {
547
547
}
548
548
} else {
549
549
if group. len ( ) > 1 {
550
- output. push ( RenderedLine :: from ( ( String :: new ( ) , Style :: NoStyle , RLK :: Elision ) ) ) ;
550
+ output. push ( RenderedLine :: from ( ( String :: new ( ) ,
551
+ Style :: NoStyle ,
552
+ RenderedLineKind :: Elision ) ) ) ;
551
553
} else {
552
554
let mut v: Vec < RenderedLine > =
553
555
group. iter ( ) . flat_map ( |line| self . render_line ( line) ) . collect ( ) ;
@@ -562,7 +564,7 @@ impl FileInfo {
562
564
fn render_line ( & self , line : & Line ) -> Vec < RenderedLine > {
563
565
let source_string = self . file . get_line ( line. line_index )
564
566
. unwrap_or ( "" ) ;
565
- let source_kind = RLK :: SourceText {
567
+ let source_kind = RenderedLineKind :: SourceText {
566
568
file : self . file . clone ( ) ,
567
569
line_index : line. line_index ,
568
570
} ;
0 commit comments