From 2a53955696f3a77dd74483caf42229ac35661e1e Mon Sep 17 00:00:00 2001 From: Thomas Hurst Date: Sun, 26 Aug 2018 00:13:15 +0100 Subject: [PATCH] Fix rendering benchmarks. --- components/rendering/benches/all.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/components/rendering/benches/all.rs b/components/rendering/benches/all.rs index e996a256..1f5f17a9 100644 --- a/components/rendering/benches/all.rs +++ b/components/rendering/benches/all.rs @@ -7,6 +7,7 @@ extern crate config; extern crate front_matter; use std::collections::HashMap; +use std::path::Path; use tera::Tera; use rendering::{RenderContext, render_content, render_shortcodes}; @@ -91,7 +92,7 @@ fn bench_render_content_with_highlighting(b: &mut test::Bencher) { tera.add_raw_template("shortcodes/youtube.html", "{{id}}").unwrap(); let permalinks_ctx = HashMap::new(); let config = Config::default(); - let context = RenderContext::new(&tera, &config, "", &permalinks_ctx, InsertAnchor::None); + let context = RenderContext::new(&tera, &config, "", &permalinks_ctx, Path::new(""), InsertAnchor::None); b.iter(|| render_content(CONTENT, &context).unwrap()); } @@ -102,7 +103,7 @@ fn bench_render_content_without_highlighting(b: &mut test::Bencher) { let permalinks_ctx = HashMap::new(); let mut config = Config::default(); config.highlight_code = false; - let context = RenderContext::new(&tera, &config, "", &permalinks_ctx, InsertAnchor::None); + let context = RenderContext::new(&tera, &config, "", &permalinks_ctx, Path::new(""), InsertAnchor::None); b.iter(|| render_content(CONTENT, &context).unwrap()); } @@ -113,7 +114,7 @@ fn bench_render_content_no_shortcode(b: &mut test::Bencher) { let mut config = Config::default(); config.highlight_code = false; let permalinks_ctx = HashMap::new(); - let context = RenderContext::new(&tera, &config, "", &permalinks_ctx, InsertAnchor::None); + let context = RenderContext::new(&tera, &config, "", &permalinks_ctx, Path::new(""), InsertAnchor::None); b.iter(|| render_content(&content2, &context).unwrap()); } @@ -124,7 +125,7 @@ fn bench_render_shortcodes_one_present(b: &mut test::Bencher) { tera.add_raw_template("shortcodes/youtube.html", "{{id}}").unwrap(); let config = Config::default(); let permalinks_ctx = HashMap::new(); - let context = RenderContext::new(&tera, &config, "", &permalinks_ctx, InsertAnchor::None); + let context = RenderContext::new(&tera, &config, "", &permalinks_ctx, Path::new(""), InsertAnchor::None); b.iter(|| render_shortcodes(CONTENT, &context)); }