Auto-fix clippy::collapsible_if violations (#36428)

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz
2025-08-19 13:27:24 +00:00
committed by GitHub
parent 9e8ec72bd5
commit 8f567383e4
281 changed files with 6625 additions and 7086 deletions
+12 -12
View File
@@ -292,10 +292,10 @@ fn paint_line(
}
if let Some(style_run) = style_run {
if let Some((_, underline_style)) = &mut current_underline {
if style_run.underline.as_ref() != Some(underline_style) {
finished_underline = current_underline.take();
}
if let Some((_, underline_style)) = &mut current_underline
&& style_run.underline.as_ref() != Some(underline_style)
{
finished_underline = current_underline.take();
}
if let Some(run_underline) = style_run.underline.as_ref() {
current_underline.get_or_insert((
@@ -310,10 +310,10 @@ fn paint_line(
},
));
}
if let Some((_, strikethrough_style)) = &mut current_strikethrough {
if style_run.strikethrough.as_ref() != Some(strikethrough_style) {
finished_strikethrough = current_strikethrough.take();
}
if let Some((_, strikethrough_style)) = &mut current_strikethrough
&& style_run.strikethrough.as_ref() != Some(strikethrough_style)
{
finished_strikethrough = current_strikethrough.take();
}
if let Some(run_strikethrough) = style_run.strikethrough.as_ref() {
current_strikethrough.get_or_insert((
@@ -509,10 +509,10 @@ fn paint_line_background(
}
if let Some(style_run) = style_run {
if let Some((_, background_color)) = &mut current_background {
if style_run.background_color.as_ref() != Some(background_color) {
finished_background = current_background.take();
}
if let Some((_, background_color)) = &mut current_background
&& style_run.background_color.as_ref() != Some(background_color)
{
finished_background = current_background.take();
}
if let Some(run_background) = style_run.background_color {
current_background.get_or_insert((
+4 -4
View File
@@ -185,10 +185,10 @@ impl LineLayout {
if width > wrap_width && boundary > last_boundary {
// When used line_clamp, we should limit the number of lines.
if let Some(max_lines) = max_lines {
if boundaries.len() >= max_lines - 1 {
break;
}
if let Some(max_lines) = max_lines
&& boundaries.len() >= max_lines - 1
{
break;
}
if let Some(last_candidate_ix) = last_candidate_ix.take() {