};
for (i, annotation) in annotations.into_iter().enumerate() {
if let Some(label) = &annotation.label {
- let style = if annotation.is_primary {
- Style::LabelPrimary
- } else {
- Style::LabelSecondary
- };
- if annotation_id == 0 {
- buffer.prepend(line_idx, " |", Style::LineNumber);
- for _ in 0..max_line_num_len {
- buffer.prepend(line_idx, " ", Style::NoStyle);
+ if !label.is_empty() {
+ let style = if annotation.is_primary {
+ Style::LabelPrimary
+ } else {
+ Style::LabelSecondary
+ };
+ if annotation_id == 0 {
+ buffer.prepend(line_idx, " |", Style::LineNumber);
+ for _ in 0..max_line_num_len {
+ buffer.prepend(line_idx, " ", Style::NoStyle);
+ }
+ line_idx += 1;
+ buffer.append(line_idx + i, " = note: ", style);
+ for _ in 0..max_line_num_len {
+ buffer.prepend(line_idx, " ", Style::NoStyle);
+ }
+ } else {
+ buffer.append(line_idx + i, ": ", style);
}
- line_idx += 1;
- buffer.append(line_idx + i, " = note: ", style);
- for _ in 0..max_line_num_len {
- buffer.prepend(line_idx, " ", Style::NoStyle);
- }
- } else {
- buffer.append(line_idx + i, ": ", style);
+ buffer.append(line_idx + i, label, style);
}
- buffer.append(line_idx + i, label, style);
}
}
}
|
note: `Option<i32>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
- |
- = note:
$SRC_DIR/core/src/option.rs:LL:COL: not covered
$SRC_DIR/core/src/option.rs:LL:COL: not covered
= note: the matched value is of type `Option<i32>`
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `Option<i32>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
- |
- = note:
$SRC_DIR/core/src/option.rs:LL:COL: not covered
= note: the matched value is of type `Option<i32>`
help: you might want to use `if let` to ignore the variant that isn't matched
|
note: `Option<i32>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
- |
- = note:
$SRC_DIR/core/src/option.rs:LL:COL: not covered
= note: the matched value is of type `Option<i32>`
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `Result<u32, !>` defined here
--> $SRC_DIR/core/src/result.rs:LL:COL
- |
- = note:
$SRC_DIR/core/src/result.rs:LL:COL: not covered
= note: the matched value is of type `Result<u32, !>`
help: you might want to use `if let` to ignore the variant that isn't matched
|
note: `Option<i32>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
- |
- = note:
$SRC_DIR/core/src/option.rs:LL:COL: not covered
= note: the matched value is of type `Option<i32>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
note: `Option<HiddenEnum>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
- |
- = note:
$SRC_DIR/core/src/option.rs:LL:COL: not covered
= note: the matched value is of type `Option<HiddenEnum>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
|
note: `Option<Enum>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
- |
- = note:
= note: the matched value is of type `Option<Enum>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms
|
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
$SRC_DIR/alloc/src/boxed.rs:LL:COL
$SRC_DIR/alloc/src/boxed.rs:LL:COL
-$SRC_DIR/alloc/src/boxed.rs:LL:COL:
+$SRC_DIR/alloc/src/boxed.rs:LL:COL
= note: the matched value is of type `Box<ElementKind>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
|
note: `Option<Option<Direction>>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
- |
- = note:
$SRC_DIR/core/src/option.rs:LL:COL: not covered
: not covered
= note: the matched value is of type `Option<Option<Direction>>`
|
note: `Option<Private>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
- |
- = note:
$SRC_DIR/core/src/option.rs:LL:COL: not covered
= note: the matched value is of type `Option<Private>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
note: `Option<i32>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
- |
- = note:
$SRC_DIR/core/src/option.rs:LL:COL: not covered
= note: the matched value is of type `Option<i32>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `Result<u32, &R<'_>>` defined here
--> $SRC_DIR/core/src/result.rs:LL:COL
- |
- = note:
$SRC_DIR/core/src/result.rs:LL:COL: not covered
= note: the matched value is of type `Result<u32, &R<'_>>`
help: you might want to use `if let` to ignore the variant that isn't matched
|
note: `Result<u32, &Void>` defined here
--> $SRC_DIR/core/src/result.rs:LL:COL
- |
- = note:
$SRC_DIR/core/src/result.rs:LL:COL: not covered
= note: the matched value is of type `Result<u32, &Void>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
note: `Result<u32, Void>` defined here
--> $SRC_DIR/core/src/result.rs:LL:COL
- |
- = note:
$SRC_DIR/core/src/result.rs:LL:COL: not covered
= note: the matched value is of type `Result<u32, Void>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
= note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
note: `Result<u32, Void>` defined here
--> $SRC_DIR/core/src/result.rs:LL:COL
- |
- = note:
$SRC_DIR/core/src/result.rs:LL:COL: not covered
= note: the matched value is of type `Result<u32, Void>`
help: you might want to use `if let` to ignore the variant that isn't matched