refactor: use map instead of explicit if let
We also use last instead of first, because the last route should be the active one. Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -20,12 +20,8 @@ impl DesktopGlobalPopup {
|
||||
}
|
||||
|
||||
let rect = ui.ctx().screen_rect().shrink(MARGIN);
|
||||
let title = if let Some(first) = routes.first() {
|
||||
// TODO(kernelkind): not a great way of getting the title of the routes 'grouping'
|
||||
Some(first.title())
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
let title = routes.last().map(|r| r.title());
|
||||
|
||||
let app_ctx = Rc::new(RefCell::new(app));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user