refactor: prefer orelse to if(pred) |x| x else y

This commit is contained in:
CJ van den Berg 2024-08-29 12:34:56 +02:00
parent 1caf2aa0f6
commit c01576412a
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
15 changed files with 43 additions and 43 deletions

View file

@ -422,7 +422,7 @@ const cmds = struct {
tui_.config.gutter_line_numbers_relative = lnr;
try tui_.save_config();
if (self.widgets.get("editor_gutter")) |gutter_widget| {
const gutter = if (gutter_widget.dynamic_cast(@import("editor_gutter.zig"))) |p| p else return;
const gutter = gutter_widget.dynamic_cast(@import("editor_gutter.zig")) orelse return;
gutter.linenum = ln;
gutter.relative = lnr;
}