You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fnbody() -> 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.
The text was updated successfully, but these errors were encountered:
/// Helper for writing nested html_to!/// Basically a lazy html! that can be rendered(-to) on demandmacro_rules! html_in {($($tt:tt)*) => {MaudFnWrapper(|buf: &mutString| maud::html_to!{ buf, $($tt)*})};}/// A bit of closure magic to work around nested html_to!structMaudFnWrapper<F>(F);impl<F>RenderforMaudFnWrapper<F>whereF:Fn(&mutString){fnrender_to(&self,buffer:&mutString){self.0(buffer)}}
Howerer this is mainly a workaround, than proper solution.
Related to #373.
For patterns like this:
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 implementRender
(therender
method would have to return something other thanMarkup
, probably justPreEscaped<String>
) and take advantage of the existingrender_to
method.The text was updated successfully, but these errors were encountered: