refactor: prefer orelse to if(pred) |x| x else y
This commit is contained in:
parent
1caf2aa0f6
commit
c01576412a
15 changed files with 43 additions and 43 deletions
|
@ -747,7 +747,7 @@ pub const KeybindHints = std.static_string_map.StaticStringMap([]const u8);
|
|||
threadlocal var instance_: ?*Self = null;
|
||||
|
||||
pub fn current() *Self {
|
||||
return if (instance_) |p| p else @panic("tui call out of context");
|
||||
return instance_ orelse @panic("tui call out of context");
|
||||
}
|
||||
|
||||
pub fn get_mode() []const u8 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue