From ad7e5e2921581b14efbfc87cc02df5be6498f621 Mon Sep 17 00:00:00 2001 From: Benjamin Lee Date: Fri, 3 Nov 2023 23:18:59 -0700 Subject: [PATCH] remove uncessary if statement start > end in all cases. --- src/handlers/graphical.rs | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/src/handlers/graphical.rs b/src/handlers/graphical.rs index 82f2f9b..8cec88b 100644 --- a/src/handlers/graphical.rs +++ b/src/handlers/graphical.rs @@ -727,26 +727,24 @@ impl GraphicalReportHandler { let vbar_offset = (start + end) / 2; let num_left = vbar_offset - start; let num_right = end - vbar_offset - 1; - if start < end { - underlines.push_str( - &format!( - "{:width$}{}{}{}", - "", - chars.underline.to_string().repeat(num_left), - if hl.len() == 0 { - chars.uarrow - } else if hl.label().is_some() { - chars.underbar - } else { - chars.underline - }, - chars.underline.to_string().repeat(num_right), - width = start.saturating_sub(highest), - ) - .style(hl.style) - .to_string(), - ); - } + underlines.push_str( + &format!( + "{:width$}{}{}{}", + "", + chars.underline.to_string().repeat(num_left), + if hl.len() == 0 { + chars.uarrow + } else if hl.label().is_some() { + chars.underbar + } else { + chars.underline + }, + chars.underline.to_string().repeat(num_right), + width = start.saturating_sub(highest), + ) + .style(hl.style) + .to_string(), + ); highest = std::cmp::max(highest, end); (hl, vbar_offset)