Skip to content

Commit aba9454

Browse files
vidhanioKijewski
authored andcommitted
render directly to output buffer
1 parent 665d5b9 commit aba9454

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tmpls/hypertext/src/lib.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ impl tmpls::Benchmark for Benchmark {
1515
output: &mut Self::Output,
1616
input: &BigTable,
1717
) -> Result<(), Self::Error> {
18-
*output = maud! {
18+
maud! {
1919
table {
2020
@for row in &input.table {
2121
tr {
@@ -26,13 +26,12 @@ impl tmpls::Benchmark for Benchmark {
2626
}
2727
}
2828
}
29-
.render()
30-
.0;
29+
.render_to(output);
3130
Ok(())
3231
}
3332

3433
fn teams(&mut self, output: &mut Self::Output, input: &Teams) -> Result<(), Self::Error> {
35-
*output = maud! {
34+
maud! {
3635
html {
3736
head {
3837
title { (input.year) }
@@ -49,8 +48,7 @@ impl tmpls::Benchmark for Benchmark {
4948
}
5049
}
5150
}
52-
.render()
53-
.0;
51+
.render_to(output);
5452
Ok(())
5553
}
5654
}

0 commit comments

Comments
 (0)