From c3cba7f22c49ca3a3f58df44d8ea4c85d8510bff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 9 Mar 2023 08:10:54 -0400 Subject: refactor(core): Extension::builder_with_deps (#18093) Prerequisite for https://github.com/denoland/deno/pull/18080 --- ext/webgpu/lib.rs | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'ext/webgpu') diff --git a/ext/webgpu/lib.rs b/ext/webgpu/lib.rs index 8e13a8050..aa6207d34 100644 --- a/ext/webgpu/lib.rs +++ b/ext/webgpu/lib.rs @@ -117,18 +117,20 @@ impl Resource for WebGpuQuerySet { } pub fn init(unstable: bool) -> Extension { - Extension::builder(env!("CARGO_PKG_NAME")) - .dependencies(vec!["deno_webidl", "deno_web"]) - .esm(include_js_files!("01_webgpu.js", "02_idl_types.js",)) - .ops(declare_webgpu_ops()) - .state(move |state| { - // TODO: check & possibly streamline this - // Unstable might be able to be OpMiddleware - // let unstable_checker = state.borrow::(); - // let unstable = unstable_checker.unstable; - state.put(Unstable(unstable)); - }) - .build() + Extension::builder_with_deps( + env!("CARGO_PKG_NAME"), + &["deno_webidl", "deno_web"], + ) + .esm(include_js_files!("01_webgpu.js", "02_idl_types.js",)) + .ops(declare_webgpu_ops()) + .state(move |state| { + // TODO: check & possibly streamline this + // Unstable might be able to be OpMiddleware + // let unstable_checker = state.borrow::(); + // let unstable = unstable_checker.unstable; + state.put(Unstable(unstable)); + }) + .build() } fn deserialize_features(features: &wgpu_types::Features) -> Vec<&'static str> { -- cgit v1.2.3