From ad6b00a2bf061a90c72737d0ecc4a58bb0a89550 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 11 Mar 2024 23:48:00 -0400 Subject: chore: enable clippy unused_async rule (#22834) --- ext/webgpu/01_webgpu.js | 14 +++++++------- ext/webgpu/lib.rs | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'ext/webgpu') diff --git a/ext/webgpu/01_webgpu.js b/ext/webgpu/01_webgpu.js index 55ca9c382..31b0a75f6 100644 --- a/ext/webgpu/01_webgpu.js +++ b/ext/webgpu/01_webgpu.js @@ -324,6 +324,7 @@ class GPU { /** * @param {GPURequestAdapterOptions} options */ + // deno-lint-ignore require-await async requestAdapter(options = {}) { webidl.assertBranded(this, GPUPrototype); options = webidl.converters.GPURequestAdapterOptions( @@ -332,7 +333,7 @@ class GPU { "Argument 1", ); - const { err, ...data } = await op_webgpu_request_adapter( + const { err, ...data } = op_webgpu_request_adapter( options.powerPreference, options.forceFallbackAdapter, ); @@ -411,6 +412,7 @@ class GPUAdapter { * @param {GPUDeviceDescriptor} descriptor * @returns {Promise} */ + // deno-lint-ignore require-await async requestDevice(descriptor = {}) { webidl.assertBranded(this, GPUAdapterPrototype); const prefix = "Failed to execute 'requestDevice' on 'GPUAdapter'"; @@ -431,7 +433,7 @@ class GPUAdapter { } } - const { rid, features, limits } = await op_webgpu_request_device( + const { rid, features, limits } = op_webgpu_request_device( this[_adapter].rid, descriptor.label, requiredFeatures, @@ -455,7 +457,7 @@ class GPUAdapter { * @param {string[]} unmaskHints * @returns {Promise} */ - async requestAdapterInfo(unmaskHints = []) { + requestAdapterInfo(unmaskHints = []) { webidl.assertBranded(this, GPUAdapterPrototype); const prefix = "Failed to execute 'requestAdapterInfo' on 'GPUAdapter'"; unmaskHints = webidl.converters["sequence"]( @@ -469,9 +471,7 @@ class GPUAdapter { architecture, device, description, - } = await op_webgpu_request_adapter_info( - this[_adapter].rid, - ); + } = op_webgpu_request_adapter_info(this[_adapter].rid); const adapterInfo = webidl.createBranded(GPUAdapterInfo); adapterInfo[_vendor] = ArrayPrototypeIncludes(unmaskHints, "vendor") @@ -484,7 +484,7 @@ class GPUAdapter { : ""; adapterInfo[_description] = ArrayPrototypeIncludes(unmaskHints, "description") ? description : ""; - return adapterInfo; + return PromiseResolve(adapterInfo); } [SymbolFor("Deno.privateCustomInspect")](inspect, inspectOptions) { diff --git a/ext/webgpu/lib.rs b/ext/webgpu/lib.rs index 99c8fcf6b..5c0dc79c2 100644 --- a/ext/webgpu/lib.rs +++ b/ext/webgpu/lib.rs @@ -381,9 +381,9 @@ pub struct GpuAdapterDevice { is_software: bool, } -#[op2(async)] +#[op2] #[serde] -pub async fn op_webgpu_request_adapter( +pub fn op_webgpu_request_adapter( state: Rc>, #[serde] power_preference: Option, force_fallback_adapter: bool, @@ -645,9 +645,9 @@ impl From for wgpu_types::Features { } } -#[op2(async)] +#[op2] #[serde] -pub async fn op_webgpu_request_device( +pub fn op_webgpu_request_device( state: Rc>, #[smi] adapter_rid: ResourceId, #[string] label: String, @@ -702,9 +702,9 @@ pub struct GPUAdapterInfo { description: String, } -#[op2(async)] +#[op2] #[serde] -pub async fn op_webgpu_request_adapter_info( +pub fn op_webgpu_request_adapter_info( state: Rc>, #[smi] adapter_rid: ResourceId, ) -> Result { -- cgit v1.2.3