Skip to content

Commit e56121c

Browse files
committed
Do not import variants from RenderedLineKind
1 parent 9a9c9af commit e56121c

File tree

1 file changed

+12
-12
lines changed
  • src/libsyntax/errors/snippet

1 file changed

+12
-12
lines changed

src/libsyntax/errors/snippet/mod.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ pub enum RenderedLineKind {
103103
Annotations,
104104
Elision,
105105
}
106-
use self::RenderedLineKind::*;
106+
use self::RenderedLineKind as RLK;
107107

108108
impl SnippetData {
109109
pub fn new(codemap: Rc<CodeMap>,
@@ -244,19 +244,19 @@ impl RenderedLine {
244244
impl RenderedLineKind {
245245
fn prefix(&self) -> StyledString {
246246
match *self {
247-
SourceText { file: _, line_index } =>
247+
RLK::SourceText { file: _, line_index } =>
248248
StyledString {
249249
text: format!("{}", line_index + 1),
250250
style: LineNumber,
251251
},
252-
Elision =>
252+
RLK::Elision =>
253253
StyledString {
254254
text: String::from("..."),
255255
style: LineNumber,
256256
},
257-
PrimaryFileName |
258-
OtherFileName |
259-
Annotations =>
257+
RLK::PrimaryFileName |
258+
RLK::OtherFileName |
259+
RLK::Annotations =>
260260
StyledString {
261261
text: String::from(""),
262262
style: LineNumber,
@@ -296,7 +296,7 @@ impl StyledBuffer {
296296
//We know our first output line is source and the rest are highlights and labels
297297
output.push(RenderedLine { text: styled_vec, kind: source_kind.clone() });
298298
} else {
299-
output.push(RenderedLine { text: styled_vec, kind: Annotations });
299+
output.push(RenderedLine { text: styled_vec, kind: RLK::Annotations });
300300
}
301301
styled_vec = vec![];
302302
}
@@ -484,7 +484,7 @@ impl FileInfo {
484484
text: format!(":{}:{}", lo.line, lo.col.0 + 1),
485485
style: LineAndColumn,
486486
}],
487-
kind: PrimaryFileName,
487+
kind: RLK::PrimaryFileName,
488488
});
489489
}
490490
None => {
@@ -493,7 +493,7 @@ impl FileInfo {
493493
text: self.file.name.clone(),
494494
style: FileNameStyle,
495495
}],
496-
kind: OtherFileName,
496+
kind: RLK::OtherFileName,
497497
});
498498
}
499499
}
@@ -534,7 +534,7 @@ impl FileInfo {
534534
if prev_ends_at_eol && is_single_unlabeled_annotated_line {
535535
if !elide_unlabeled_region {
536536
output.push(RenderedLine::from((String::new(),
537-
NoStyle, Elision)));
537+
NoStyle, RLK::Elision)));
538538
elide_unlabeled_region = true;
539539
prev_ends_at_eol = true;
540540
}
@@ -548,7 +548,7 @@ impl FileInfo {
548548
}
549549
} else {
550550
if group.len() > 1 {
551-
output.push(RenderedLine::from((String::new(), NoStyle, Elision)));
551+
output.push(RenderedLine::from((String::new(), NoStyle, RLK::Elision)));
552552
} else {
553553
let mut v: Vec<RenderedLine> =
554554
group.iter().flat_map(|line| self.render_line(line)).collect();
@@ -563,7 +563,7 @@ impl FileInfo {
563563
fn render_line(&self, line: &Line) -> Vec<RenderedLine> {
564564
let source_string = self.file.get_line(line.line_index)
565565
.unwrap_or("");
566-
let source_kind = SourceText {
566+
let source_kind = RLK::SourceText {
567567
file: self.file.clone(),
568568
line_index: line.line_index,
569569
};

0 commit comments

Comments
 (0)