Skip to content

Make nested html! invocations lazy #381

@mattfbacon

Description

@mattfbacon

Related to #373.

For patterns like this:

fn body() -> Markup { ... }

html! {
  h1 { "My page" }
  main { (body()) }
}

There is technically no need for the intermediate buffer from body, because the markup could render directly into the outer buffer.

In my ideal API, Markup would just implement Render (the render method would have to return something other than Markup, probably just PreEscaped<String>) and take advantage of the existing render_to method.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions