Skip to content

Commit

Permalink
Prefer unwrap_or_else
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathspy committed Jun 12, 2022
1 parent dac30dd commit 0b45660
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions helix-term/src/ui/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,9 @@ impl EditorView {
theme: &Theme,
) {
let editor_rulers = &editor.config().rulers;
let default_style = Style::default().bg(Color::Red);
let ruler_theme = theme.try_get("ui.virtual.ruler").unwrap_or(default_style);
let ruler_theme = theme
.try_get("ui.virtual.ruler")
.unwrap_or_else(|| Style::default().bg(Color::Red));

let rulers = doc
.language_config()
Expand Down

0 comments on commit 0b45660

Please sign in to comment.