diff options
author | Aaron O'Mullan <aaron.omullan@gmail.com> | 2021-04-29 00:16:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-28 18:16:45 -0400 |
commit | e89295b176b4f494d19b547b6b4d7c98d0cf1da1 (patch) | |
tree | ae2f043d8a883b6f6f754c057b8dfe678b3c7944 /op_crates/webgpu | |
parent | e63c53315450ed305752566f4c3ad2bb76c8b8a3 (diff) |
refactor(extensions): reintroduce builder (#10412)
Diffstat (limited to 'op_crates/webgpu')
-rw-r--r-- | op_crates/webgpu/lib.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/op_crates/webgpu/lib.rs b/op_crates/webgpu/lib.rs index a9cbbb882..b5b2905b2 100644 --- a/op_crates/webgpu/lib.rs +++ b/op_crates/webgpu/lib.rs @@ -95,22 +95,22 @@ impl Resource for WebGpuQuerySet { } pub fn init(unstable: bool) -> Extension { - Extension::with_ops( - include_js_files!( + Extension::builder() + .js(include_js_files!( prefix "deno:op_crates/webgpu", "01_webgpu.js", "02_idl_types.js", - ), - declare_webgpu_ops(), - Some(Box::new(move |state| { + )) + .ops(declare_webgpu_ops()) + .state(move |state| { // TODO: check & possibly streamline this // Unstable might be able to be OpMiddleware // let unstable_checker = state.borrow::<super::UnstableChecker>(); // let unstable = unstable_checker.unstable; state.put(Unstable(unstable)); Ok(()) - })), - ) + }) + .build() } pub fn get_declaration() -> PathBuf { |