Skip to content

Commit

Permalink
use unwrap_or
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk authored Jan 6, 2024
1 parent c529795 commit 3935b41
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions crates/egui_plot/src/legend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,7 @@ impl LegendWidget {
hidden_items: &ahash::HashSet<String>, // Existing hiddent items in the plot memory.
) -> Option<Self> {
// If `config.hidden_items` is not `None`, it is used.
let hidden_items = match &config.hidden_items {
Some(h) => h,
None => hidden_items,
};
let hidden_items = config.hidden_items.as_ref().unwrap_or(hidden_items);

// Collect the legend entries. If multiple items have the same name, they share a
// checkbox. If their colors don't match, we pick a neutral color for the checkbox.
Expand Down

0 comments on commit 3935b41

Please sign in to comment.