From d873c37e31fb052fb376caada6780137e176a6e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Wed, 1 Jul 2020 07:19:51 +0200 Subject: [PATCH] Update `dodrio` dependency in `iced_web` --- web/Cargo.toml | 4 ++-- web/src/lib.rs | 19 ++++++++----------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/web/Cargo.toml b/web/Cargo.toml index 88c3102f..e03d2b63 100644 --- a/web/Cargo.toml +++ b/web/Cargo.toml @@ -15,8 +15,8 @@ categories = ["web-programming"] maintenance = { status = "actively-developed" } [dependencies] -dodrio = "0.1.0" -wasm-bindgen = "0.2.51" +dodrio = "0.2" +wasm-bindgen = "0.2" wasm-bindgen-futures = "0.4" url = "2.0" num-traits = "0.2" diff --git a/web/src/lib.rs b/web/src/lib.rs index 53b54b7e..b7970c56 100644 --- a/web/src/lib.rs +++ b/web/src/lib.rs @@ -238,28 +238,25 @@ struct Instance { bus: Bus, } -impl dodrio::Render for Instance +impl<'a, A> dodrio::Render<'a> for Instance where A: Application, { - fn render<'a, 'bump>( - &'a self, - bump: &'bump bumpalo::Bump, - ) -> dodrio::Node<'bump> - where - 'a: 'bump, - { + fn render( + &self, + context: &mut dodrio::RenderContext<'a>, + ) -> dodrio::Node<'a> { use dodrio::builder::*; let mut ui = self.application.borrow_mut(); let element = ui.view(); let mut css = Css::new(); - let node = element.widget.node(bump, &self.bus, &mut css); + let node = element.widget.node(context.bump, &self.bus, &mut css); - div(bump) + div(context.bump) .attr("style", "width: 100%; height: 100%") - .children(vec![css.node(bump), node]) + .children(vec![css.node(context.bump), node]) .finish() } }