Less nesting in webgpu response (#32799)

* Remove Option wrap of WebGPUResponse

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Replace WebGPUResponseResult with WebGPUResponse

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
Samson 2024-07-17 22:37:52 +02:00 committed by GitHub
parent 1223335547
commit 34eed29037
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 196 additions and 214 deletions

View file

@ -5,7 +5,7 @@
use std::rc::Rc;
use dom_struct::dom_struct;
use webgpu::{WebGPU, WebGPURequest, WebGPUResponse, WebGPUResponseResult, WebGPUShaderModule};
use webgpu::{WebGPU, WebGPURequest, WebGPUResponse, WebGPUShaderModule};
use super::gpu::AsyncWGPUListener;
use super::gpucompilationinfo::GPUCompilationInfo;
@ -89,9 +89,9 @@ impl GPUShaderModuleMethods for GPUShaderModule {
}
impl AsyncWGPUListener for GPUShaderModule {
fn handle_response(&self, response: Option<WebGPUResponseResult>, promise: &Rc<Promise>) {
fn handle_response(&self, response: WebGPUResponse, promise: &Rc<Promise>) {
match response {
Some(Ok(WebGPUResponse::CompilationInfo(info))) => {
WebGPUResponse::CompilationInfo(info) => {
let info = GPUCompilationInfo::from(&self.global(), info);
promise.resolve_native(&info);
},