Skip to content

Commit 89c9aba

Browse files
committed
Fix one more clippy issue and add back some code I thought was dead
1 parent e97c3e2 commit 89c9aba

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,7 @@ impl Default for Config {
530530

531531
#[test]
532532
#[should_panic]
533+
#[allow(clippy::reversed_empty_ranges)]
533534
fn backwards_label_should_panic() {
534535
Label::new(1..0);
535536
}

src/write.rs

+14-1
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,20 @@ impl<S: Span> Report<'_, S> {
723723
let underline = get_underline(col).filter(|_| row == 0);
724724
let [c, tail] = if let Some(vbar_ll) = vbar {
725725
let [c, tail] = if underline.is_some() {
726-
[draw.underbar, draw.underline]
726+
// TODO: Is this good?
727+
// The `true` is used here because it's temporarily disabling a
728+
// feature that might be reenabled later.
729+
#[allow(clippy::overly_complex_bool_expr)]
730+
if ExactSizeIterator::len(&vbar_ll.label.char_span) <= 1 || true
731+
{
732+
[draw.underbar, draw.underline]
733+
} else if line.offset() + col == vbar_ll.label.char_span.start {
734+
[draw.ltop, draw.underbar]
735+
} else if line.offset() + col == vbar_ll.label.last_offset() {
736+
[draw.rtop, draw.underbar]
737+
} else {
738+
[draw.underbar, draw.underline]
739+
}
727740
} else if vbar_ll.multi && row == 0 && self.config.multiline_arrows
728741
{
729742
[draw.uarrow, ' ']

0 commit comments

Comments
 (0)