summaryrefslogtreecommitdiff
path: root/benches
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-05-25 11:16:03 +0200
committerLaurenz <laurmaedje@gmail.com>2022-05-25 11:16:03 +0200
commit3309ff9fe5ea36134e8ddf11ac2c84613b569856 (patch)
treeb3eb48d444a5dee7273a76c548a64be96d76f0b9 /benches
parent362a7f2a8ac76f944efa05eabcab0960817777c5 (diff)
Slim down context
Diffstat (limited to 'benches')
-rw-r--r--benches/oneshot.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/benches/oneshot.rs b/benches/oneshot.rs
index 6fd16d59..5c0fc701 100644
--- a/benches/oneshot.rs
+++ b/benches/oneshot.rs
@@ -1,4 +1,5 @@
use std::path::Path;
+use std::sync::Arc;
use iai::{black_box, main, Iai};
use unscanny::Scanner;
@@ -7,14 +8,14 @@ use typst::loading::MemLoader;
use typst::parse::{parse, TokenMode, Tokens};
use typst::source::SourceId;
use typst::syntax::highlight_node;
-use typst::Context;
+use typst::{Config, Context};
const SRC: &str = include_str!("bench.typ");
const FONT: &[u8] = include_bytes!("../fonts/IBMPlexSans-Regular.ttf");
fn context() -> (Context, SourceId) {
- let loader = MemLoader::new().with(Path::new("font.ttf"), FONT).wrap();
- let mut ctx = Context::new(loader);
+ let loader = MemLoader::new().with(Path::new("font.ttf"), FONT);
+ let mut ctx = Context::new(Arc::new(loader), Config::default());
let id = ctx.sources.provide(Path::new("src.typ"), SRC.to_string());
(ctx, id)
}