lib: add Render::render_{event, prologue, epilogue}
derive push/write automatically from these
This commit is contained in:
parent
e506fffed8
commit
e8503e28fd
8 changed files with 73 additions and 48 deletions
|
@ -51,7 +51,9 @@ fn gen_html(c: &mut criterion::Criterion) {
|
|||
|| jotdown::Parser::new(input).collect::<Vec<_>>(),
|
||||
|p| {
|
||||
let mut s = String::new();
|
||||
jotdown::html::Renderer.push(p.into_iter(), &mut s).unwrap();
|
||||
jotdown::html::Renderer::default()
|
||||
.push(p.into_iter(), &mut s)
|
||||
.unwrap();
|
||||
s
|
||||
},
|
||||
criterion::BatchSize::SmallInput,
|
||||
|
@ -72,7 +74,7 @@ fn gen_full(c: &mut criterion::Criterion) {
|
|||
|b, &input| {
|
||||
b.iter_with_large_drop(|| {
|
||||
let mut s = String::new();
|
||||
jotdown::html::Renderer
|
||||
jotdown::html::Renderer::default()
|
||||
.push(jotdown::Parser::new(input), &mut s)
|
||||
.unwrap();
|
||||
s
|
||||
|
|
|
@ -12,7 +12,7 @@ fn block_inline() -> Option<jotdown::Event<'static>> {
|
|||
|
||||
fn full() -> String {
|
||||
let mut s = String::new();
|
||||
jotdown::html::Renderer
|
||||
jotdown::html::Renderer::default()
|
||||
.push(jotdown::Parser::new(bench_input::ALL), &mut s)
|
||||
.unwrap();
|
||||
s
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue