From e7954413e16d5814db5da6389f8d6e0c328812aa Mon Sep 17 00:00:00 2001 From: Yusuke Tanaka Date: Fri, 26 Mar 2021 03:17:37 +0900 Subject: upgrade: Rust 1.51.0 (#9895) --- op_crates/webgpu/lib.rs | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'op_crates/webgpu/lib.rs') diff --git a/op_crates/webgpu/lib.rs b/op_crates/webgpu/lib.rs index 046472905..5c3b99329 100644 --- a/op_crates/webgpu/lib.rs +++ b/op_crates/webgpu/lib.rs @@ -18,8 +18,8 @@ use std::rc::Rc; pub use wgpu_core; pub use wgpu_types; -use error::DOMExceptionOperationError; -use error::WebGPUError; +use error::DomExceptionOperationError; +use error::WebGpuError; #[macro_use] mod macros { @@ -71,22 +71,22 @@ fn check_unstable(state: &OpState, api_name: &str) { type Instance = wgpu_core::hub::Global; -struct WebGPUAdapter(wgpu_core::id::AdapterId); -impl Resource for WebGPUAdapter { +struct WebGpuAdapter(wgpu_core::id::AdapterId); +impl Resource for WebGpuAdapter { fn name(&self) -> Cow { "webGPUAdapter".into() } } -struct WebGPUDevice(wgpu_core::id::DeviceId); -impl Resource for WebGPUDevice { +struct WebGpuDevice(wgpu_core::id::DeviceId); +impl Resource for WebGpuDevice { fn name(&self) -> Cow { "webGPUDevice".into() } } -struct WebGPUQuerySet(wgpu_core::id::QuerySetId); -impl Resource for WebGPUQuerySet { +struct WebGpuQuerySet(wgpu_core::id::QuerySetId); +impl Resource for WebGpuQuerySet { fn name(&self) -> Cow { "webGPUQuerySet".into() } @@ -255,7 +255,7 @@ pub async fn op_webgpu_request_adapter( "maxUniformBufferBindingSize": adapter_limits.max_uniform_buffer_binding_size }); - let rid = state.resource_table.add(WebGPUAdapter(adapter)); + let rid = state.resource_table.add(WebGpuAdapter(adapter)); Ok(json!({ "rid": rid, @@ -267,7 +267,7 @@ pub async fn op_webgpu_request_adapter( #[derive(Deserialize)] #[serde(rename_all = "camelCase")] -struct GPULimits { +struct GpuLimits { _max_texture_dimension1d: Option, _max_texture_dimension2d: Option, _max_texture_dimension3d: Option, @@ -293,7 +293,7 @@ pub struct RequestDeviceArgs { adapter_rid: ResourceId, label: Option, non_guaranteed_features: Option>, - non_guaranteed_limits: Option, + non_guaranteed_limits: Option, } pub async fn op_webgpu_request_device( @@ -304,7 +304,7 @@ pub async fn op_webgpu_request_device( let mut state = state.borrow_mut(); let adapter_resource = state .resource_table - .get::(args.adapter_rid) + .get::(args.adapter_rid) .ok_or_else(bad_resource_id)?; let adapter = adapter_resource.0; let instance = state.borrow::(); @@ -430,7 +430,7 @@ pub async fn op_webgpu_request_device( std::marker::PhantomData )); if let Some(err) = maybe_err { - return Err(DOMExceptionOperationError::new(&err.to_string()).into()); + return Err(DomExceptionOperationError::new(&err.to_string()).into()); } let device_features = @@ -449,7 +449,7 @@ pub async fn op_webgpu_request_device( "maxUniformBufferBindingSize": limits.max_uniform_buffer_binding_size, }); - let rid = state.resource_table.add(WebGPUDevice(device)); + let rid = state.resource_table.add(WebGpuDevice(device)); Ok(json!({ "rid": rid, @@ -476,7 +476,7 @@ pub fn op_webgpu_create_query_set( ) -> Result { let device_resource = state .resource_table - .get::(args.device_rid) + .get::(args.device_rid) .ok_or_else(bad_resource_id)?; let device = device_resource.0; let instance = &state.borrow::(); @@ -542,10 +542,10 @@ pub fn op_webgpu_create_query_set( std::marker::PhantomData )); - let rid = state.resource_table.add(WebGPUQuerySet(query_set)); + let rid = state.resource_table.add(WebGpuQuerySet(query_set)); Ok(json!({ "rid": rid, - "err": maybe_err.map(WebGPUError::from), + "err": maybe_err.map(WebGpuError::from), })) } -- cgit v1.2.3