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

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-08-19 15:27:24 +02:00 committed by GitHub
parent 9e8ec72bd5
commit 8f567383e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
281 changed files with 6628 additions and 7089 deletions

View file

@ -583,15 +583,15 @@ impl TerminalElement {
strikethrough,
};
if let Some((style, range)) = hyperlink {
if range.contains(&indexed.point) {
if let Some(underline) = style.underline {
result.underline = Some(underline);
}
if let Some((style, range)) = hyperlink
&& range.contains(&indexed.point)
{
if let Some(underline) = style.underline {
result.underline = Some(underline);
}
if let Some(color) = style.color {
result.color = color;
}
if let Some(color) = style.color {
result.color = color;
}
}
@ -1275,9 +1275,9 @@ impl Element for TerminalElement {
}
let text_paint_time = text_paint_start.elapsed();
if let Some(text_to_mark) = &marked_text_cloned {
if !text_to_mark.is_empty() {
if let Some(cursor_layout) = &original_cursor {
if let Some(text_to_mark) = &marked_text_cloned
&& !text_to_mark.is_empty()
&& let Some(cursor_layout) = &original_cursor {
let ime_position = cursor_layout.bounding_rect(origin).origin;
let mut ime_style = layout.base_text_style.clone();
ime_style.underline = Some(UnderlineStyle {
@ -1303,14 +1303,11 @@ impl Element for TerminalElement {
.paint(ime_position, layout.dimensions.line_height, window, cx)
.log_err();
}
}
}
if self.cursor_visible && marked_text_cloned.is_none() {
if let Some(mut cursor) = original_cursor {
if self.cursor_visible && marked_text_cloned.is_none()
&& let Some(mut cursor) = original_cursor {
cursor.paint(origin, window, cx);
}
}
if let Some(mut element) = block_below_cursor_element {
element.paint(window, cx);