mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 06:22:00 +00:00
Simplify code for special case of annotation
This commit is contained in:
parent
75a7c27a54
commit
7dc953b493
@ -622,18 +622,16 @@ impl EmitterWriter {
|
|||||||
// 3 | |
|
// 3 | |
|
||||||
// 4 | | }
|
// 4 | | }
|
||||||
// | |_^ test
|
// | |_^ test
|
||||||
if line.annotations.len() == 1 {
|
if let [ann] = &line.annotations[..] {
|
||||||
if let Some(ref ann) = line.annotations.get(0) {
|
if let AnnotationType::MultilineStart(depth) = ann.annotation_type {
|
||||||
if let AnnotationType::MultilineStart(depth) = ann.annotation_type {
|
if source_string.chars().take(ann.start_col).all(|c| c.is_whitespace()) {
|
||||||
if source_string.chars().take(ann.start_col).all(|c| c.is_whitespace()) {
|
let style = if ann.is_primary {
|
||||||
let style = if ann.is_primary {
|
Style::UnderlinePrimary
|
||||||
Style::UnderlinePrimary
|
} else {
|
||||||
} else {
|
Style::UnderlineSecondary
|
||||||
Style::UnderlineSecondary
|
};
|
||||||
};
|
buffer.putc(line_offset, width_offset + depth - 1, '/', style);
|
||||||
buffer.putc(line_offset, width_offset + depth - 1, '/', style);
|
return vec![(depth, style)];
|
||||||
return vec![(depth, style)];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user