mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
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:
parent
1223335547
commit
34eed29037
11 changed files with 196 additions and 214 deletions
|
@ -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);
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue