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,8 +622,7 @@ impl EmitterWriter {
|
||||
// 3 | |
|
||||
// 4 | | }
|
||||
// | |_^ test
|
||||
if line.annotations.len() == 1 {
|
||||
if let Some(ref ann) = line.annotations.get(0) {
|
||||
if let [ann] = &line.annotations[..] {
|
||||
if let AnnotationType::MultilineStart(depth) = ann.annotation_type {
|
||||
if source_string.chars().take(ann.start_col).all(|c| c.is_whitespace()) {
|
||||
let style = if ann.is_primary {
|
||||
@ -636,7 +635,6 @@ impl EmitterWriter {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// We want to display like this:
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user