refactor: `match` over `if`

pull/13133/head
Nik Revenco 2025-03-25 21:27:14 +00:00
parent ab5663891c
commit 082ba4d741
1 changed files with 47 additions and 43 deletions

View File

@ -254,7 +254,9 @@ impl EditorView {
decorations: &mut DecorationManager, decorations: &mut DecorationManager,
theme: &Theme, theme: &Theme,
) { ) {
if inline_blame.behaviour == InlineBlameBehaviour::CursorLine { match inline_blame.behaviour {
InlineBlameBehaviour::Hidden => (),
InlineBlameBehaviour::CursorLine => {
let cursor_line_idx = doc.cursor_line(view.id); let cursor_line_idx = doc.cursor_line(view.id);
// do not render inline blame for empty lines to reduce visual noise // do not render inline blame for empty lines to reduce visual noise
@ -267,7 +269,8 @@ impl EditorView {
)); ));
}; };
} }
} else if inline_blame.behaviour == InlineBlameBehaviour::AllLines { },
InlineBlameBehaviour::AllLines => {
let text = doc.text(); let text = doc.text();
let text_line_count = text.len_lines(); let text_line_count = text.len_lines();
let view_height = view.inner_height(); let view_height = view.inner_height();
@ -301,6 +304,7 @@ impl EditorView {
theme, theme,
text_decorations::blame::LineBlame::ManyLines(blame_lines), text_decorations::blame::LineBlame::ManyLines(blame_lines),
)); ));
},
} }
} }