From becbb56b19e96e4dd72b861217a855fba953d290 Mon Sep 17 00:00:00 2001 From: Valentin Anger Date: Mon, 1 Jun 2020 20:20:47 +0200 Subject: feat(core): Ops can take several zero copy buffers (#4788) --- deno_typescript/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'deno_typescript/lib.rs') diff --git a/deno_typescript/lib.rs b/deno_typescript/lib.rs index a56c4fa7c..52fb00b76 100644 --- a/deno_typescript/lib.rs +++ b/deno_typescript/lib.rs @@ -50,15 +50,15 @@ pub struct TSState { fn compiler_op( ts_state: Arc>, dispatcher: D, -) -> impl Fn(&mut CoreIsolateState, &[u8], Option) -> Op +) -> impl Fn(&mut CoreIsolateState, &[u8], &mut [ZeroCopyBuf]) -> Op where D: Fn(&mut TSState, &[u8]) -> Op, { move |_state: &mut CoreIsolateState, control: &[u8], - zero_copy_buf: Option| + zero_copy_bufs: &mut [ZeroCopyBuf]| -> Op { - assert!(zero_copy_buf.is_none()); // zero_copy_buf unused in compiler. + assert!(zero_copy_bufs.is_empty()); // zero_copy_bufs unused in compiler. let mut s = ts_state.lock().unwrap(); dispatcher(&mut s, control) } @@ -332,15 +332,15 @@ pub fn trace_serializer() { /// CoreIsolate. pub fn op_fetch_asset( custom_assets: HashMap, -) -> impl Fn(&mut CoreIsolateState, &[u8], Option) -> Op { +) -> impl Fn(&mut CoreIsolateState, &[u8], &mut [ZeroCopyBuf]) -> Op { for (_, path) in custom_assets.iter() { println!("cargo:rerun-if-changed={}", path.display()); } move |_state: &mut CoreIsolateState, control: &[u8], - zero_copy_buf: Option| + zero_copy_bufs: &mut [ZeroCopyBuf]| -> Op { - assert!(zero_copy_buf.is_none()); // zero_copy_buf unused in this op. + assert!(zero_copy_bufs.is_empty()); // zero_copy_bufs unused in this op. let name = std::str::from_utf8(control).unwrap(); let asset_code = if let Some(source_code) = get_asset(name) { -- cgit v1.2.3