Skip to content

Commit

Permalink
Fix one more clippy issue and add back some code I thought was dead
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadfawaz authored and zesterer committed Apr 9, 2024
1 parent 7db6a58 commit 6c9c6a7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ impl Default for Config {

#[test]
#[should_panic]
#[allow(clippy::reversed_empty_ranges)]
fn backwards_label_should_panic() {
Label::new(1..0);
}
15 changes: 14 additions & 1 deletion src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,20 @@ impl<S: Span> Report<'_, S> {
let underline = get_underline(col).filter(|_| row == 0);
let [c, tail] = if let Some(vbar_ll) = vbar {
let [c, tail] = if underline.is_some() {
[draw.underbar, draw.underline]
// TODO: Is this good?
// The `true` is used here because it's temporarily disabling a
// feature that might be reenabled later.
#[allow(clippy::overly_complex_bool_expr)]
if ExactSizeIterator::len(&vbar_ll.label.char_span) <= 1 || true
{
[draw.underbar, draw.underline]
} else if line.offset() + col == vbar_ll.label.char_span.start {
[draw.ltop, draw.underbar]
} else if line.offset() + col == vbar_ll.label.last_offset() {
[draw.rtop, draw.underbar]
} else {
[draw.underbar, draw.underline]
}
} else if vbar_ll.multi && row == 0 && self.config.multiline_arrows
{
[draw.uarrow, ' ']
Expand Down

0 comments on commit 6c9c6a7

Please sign in to comment.