From 09aa905f7ca34630a0cdbdfbad05826627b0ab93 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Mon, 14 Dec 2020 11:24:37 +0100 Subject: [PATCH] egui_glium::run parameter `app` now has signature Box --- demo_glium/src/main.rs | 2 +- egui_glium/CHANGELOG.md | 6 ++++++ egui_glium/src/backend.rs | 6 +----- example_glium/src/main.rs | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/demo_glium/src/main.rs b/demo_glium/src/main.rs index cf13eaa6..29a35101 100644 --- a/demo_glium/src/main.rs +++ b/demo_glium/src/main.rs @@ -12,5 +12,5 @@ fn main() { // let storage = egui::app::DummyStorage::default(); let app: egui::DemoApp = egui::app::get_value(&storage, egui::app::APP_KEY).unwrap_or_default(); - egui_glium::run(title, Box::new(storage), app); + egui_glium::run(title, Box::new(storage), Box::new(app)); } diff --git a/egui_glium/CHANGELOG.md b/egui_glium/CHANGELOG.md index 8d6a6d02..29c18cd5 100644 --- a/egui_glium/CHANGELOG.md +++ b/egui_glium/CHANGELOG.md @@ -8,6 +8,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Changed +* `egui_glium::run`: the parameter `app` now has signature `Box` (you need to add `Box::new(app)` to your code). + +## 0.5.0 - 2020-12-13 + +### Changed + * FileStorage::from_path now takes `Into` instead of `String` ## 0.4.0 - 2020-11-28 diff --git a/egui_glium/src/backend.rs b/egui_glium/src/backend.rs index 46aa80d7..e0c80030 100644 --- a/egui_glium/src/backend.rs +++ b/egui_glium/src/backend.rs @@ -64,11 +64,7 @@ fn create_display( } /// Run an egui app -pub fn run( - title: &str, - mut storage: Box, - mut app: impl App + 'static, -) -> ! { +pub fn run(title: &str, mut storage: Box, mut app: Box) -> ! { let window_settings: Option = egui::app::get_value(storage.as_ref(), WINDOW_KEY); let event_loop = glutin::event_loop::EventLoop::with_user_event(); diff --git a/example_glium/src/main.rs b/example_glium/src/main.rs index 2b8a72fc..384a0a13 100644 --- a/example_glium/src/main.rs +++ b/example_glium/src/main.rs @@ -18,5 +18,5 @@ fn main() { // Restore `example_app` from file, or create new `ExampleApp`: let app: ExampleApp = egui::app::get_value(&storage, egui::app::APP_KEY).unwrap_or_default(); - egui_glium::run(title, Box::new(storage), app); + egui_glium::run(title, Box::new(storage), Box::new(app)); }