Update `dodrio` dependency in `iced_web`

This commit is contained in:
Héctor Ramón Jiménez 2020-07-01 07:19:51 +02:00
parent 08e13e00f1
commit d873c37e31
2 changed files with 10 additions and 13 deletions

View File

@ -15,8 +15,8 @@ categories = ["web-programming"]
maintenance = { status = "actively-developed" } maintenance = { status = "actively-developed" }
[dependencies] [dependencies]
dodrio = "0.1.0" dodrio = "0.2"
wasm-bindgen = "0.2.51" wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4" wasm-bindgen-futures = "0.4"
url = "2.0" url = "2.0"
num-traits = "0.2" num-traits = "0.2"

View File

@ -238,28 +238,25 @@ struct Instance<A: Application> {
bus: Bus<A::Message>, bus: Bus<A::Message>,
} }
impl<A> dodrio::Render for Instance<A> impl<'a, A> dodrio::Render<'a> for Instance<A>
where where
A: Application, A: Application,
{ {
fn render<'a, 'bump>( fn render(
&'a self, &self,
bump: &'bump bumpalo::Bump, context: &mut dodrio::RenderContext<'a>,
) -> dodrio::Node<'bump> ) -> dodrio::Node<'a> {
where
'a: 'bump,
{
use dodrio::builder::*; use dodrio::builder::*;
let mut ui = self.application.borrow_mut(); let mut ui = self.application.borrow_mut();
let element = ui.view(); let element = ui.view();
let mut css = Css::new(); 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%") .attr("style", "width: 100%; height: 100%")
.children(vec![css.node(bump), node]) .children(vec![css.node(context.bump), node])
.finish() .finish()
} }
} }