Auto-fix clippy::collapsible_if violations (#36428)
Release Notes: - N/A
This commit is contained in:
@@ -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((
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user