aboutsummaryrefslogtreecommitdiffstats
path: root/askama_escape/benches
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2019-01-10 17:19:28 +0100
committerLibravatar Juan Aguilar <mhpoin@gmail.com>2019-01-12 09:16:20 +0100
commit467f4ade19fa34983de7e6f6d81c6b4d5ff140fe (patch)
tree3fdbb337ca41d5c6cb2448af15792857d1ed7c2b /askama_escape/benches
parenta2bdf3b138c22e057a75bfe3b0a96f946327adc8 (diff)
downloadaskama-467f4ade19fa34983de7e6f6d81c6b4d5ff140fe.tar.gz
askama-467f4ade19fa34983de7e6f6d81c6b4d5ff140fe.tar.bz2
askama-467f4ade19fa34983de7e6f6d81c6b4d5ff140fe.zip
Specify a trait that handles the output format's escaping
Diffstat (limited to 'askama_escape/benches')
-rw-r--r--askama_escape/benches/all.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/askama_escape/benches/all.rs b/askama_escape/benches/all.rs
index af28c43..a98f2d7 100644
--- a/askama_escape/benches/all.rs
+++ b/askama_escape/benches/all.rs
@@ -1,7 +1,7 @@
#[macro_use]
extern crate criterion;
-use askama_escape::MarkupDisplay;
+use askama_escape::{Html, MarkupDisplay};
use criterion::Criterion;
criterion_main!(benches);
@@ -68,10 +68,10 @@ quis lacus at, gravida maximus elit. Duis tristique, nisl nullam.
"#;
b.iter(|| {
- format!("{}", MarkupDisplay::from(string_long));
- format!("{}", MarkupDisplay::from(string_short));
- format!("{}", MarkupDisplay::from(empty));
- format!("{}", MarkupDisplay::from(no_escape));
- format!("{}", MarkupDisplay::from(no_escape_long));
+ format!("{}", MarkupDisplay::new_unsafe(string_long, Html));
+ format!("{}", MarkupDisplay::new_unsafe(string_short, Html));
+ format!("{}", MarkupDisplay::new_unsafe(empty, Html));
+ format!("{}", MarkupDisplay::new_unsafe(no_escape, Html));
+ format!("{}", MarkupDisplay::new_unsafe(no_escape_long, Html));
});
}