summaryrefslogtreecommitdiff
path: root/ext/webgpu/shader.rs
diff options
context:
space:
mode:
authorAaron O'Mullan <aaron.omullan@gmail.com>2021-08-15 13:29:19 +0200
committerGitHub <noreply@github.com>2021-08-15 13:29:19 +0200
commit2ca454b402d48c1808f8233c5adedc11b714c63c (patch)
tree592f9e877e9b0ae92be80383ab723cc290e4b01e /ext/webgpu/shader.rs
parent18ff6bb053d600c277613628a256fe5fdd4dda67 (diff)
refactor(ops): return BadResource errors in ResourceTable calls (#11710)
* refactor(ops): return BadResource errors in ResourceTable calls Instead of relying on callers to map Options to Results via `.ok_or_else(bad_resource_id)` at over 176 different call sites ...
Diffstat (limited to 'ext/webgpu/shader.rs')
-rw-r--r--ext/webgpu/shader.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/ext/webgpu/shader.rs b/ext/webgpu/shader.rs
index f48411969..bd3b03f55 100644
--- a/ext/webgpu/shader.rs
+++ b/ext/webgpu/shader.rs
@@ -1,6 +1,5 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
-use deno_core::error::bad_resource_id;
use deno_core::error::null_opbuf;
use deno_core::error::AnyError;
use deno_core::ResourceId;
@@ -35,8 +34,7 @@ pub fn op_webgpu_create_shader_module(
let instance = state.borrow::<super::Instance>();
let device_resource = state
.resource_table
- .get::<super::WebGpuDevice>(args.device_rid)
- .ok_or_else(bad_resource_id)?;
+ .get::<super::WebGpuDevice>(args.device_rid)?;
let device = device_resource.0;
let source = match args.code {