Use match
statement in Content::overlay
... to improve readability a bit.
This commit is contained in:
parent
27b42ca6b6
commit
15c17a7250
@ -195,13 +195,12 @@ where
|
|||||||
) -> Option<overlay::Element<'_, Message, Renderer>> {
|
) -> Option<overlay::Element<'_, Message, Renderer>> {
|
||||||
if let Some(title_bar) = self.title_bar.as_mut() {
|
if let Some(title_bar) = self.title_bar.as_mut() {
|
||||||
let mut children = layout.children();
|
let mut children = layout.children();
|
||||||
let title_bar_layout = children.next().unwrap();
|
let title_bar_layout = children.next()?;
|
||||||
|
|
||||||
if let Some(overlay) = title_bar.overlay(title_bar_layout) {
|
match title_bar.overlay(title_bar_layout) {
|
||||||
return Some(overlay);
|
Some(overlay) => Some(overlay),
|
||||||
|
None => self.body.overlay(children.next()?),
|
||||||
}
|
}
|
||||||
|
|
||||||
self.body.overlay(children.next()?)
|
|
||||||
} else {
|
} else {
|
||||||
self.body.overlay(layout)
|
self.body.overlay(layout)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user