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/error.rs | 112 +++++++++++++++++++++++----------------------- 1 file changed, 56 insertions(+), 56 deletions(-) (limited to 'op_crates/webgpu/error.rs') diff --git a/op_crates/webgpu/error.rs b/op_crates/webgpu/error.rs index e793dabfa..52741d984 100644 --- a/op_crates/webgpu/error.rs +++ b/op_crates/webgpu/error.rs @@ -29,81 +29,81 @@ use wgpu_core::resource::CreateTextureViewError; #[derive(Serialize)] #[serde(tag = "type", content = "value")] #[serde(rename_all = "kebab-case")] -pub enum WebGPUError { +pub enum WebGpuError { Lost, OutOfMemory, Validation(String), } -impl From for WebGPUError { +impl From for WebGpuError { fn from(err: CreateBufferError) -> Self { match err { CreateBufferError::Device(err) => err.into(), CreateBufferError::AccessError(err) => err.into(), - err => WebGPUError::Validation(err.to_string()), + err => WebGpuError::Validation(err.to_string()), } } } -impl From for WebGPUError { +impl From for WebGpuError { fn from(err: DeviceError) -> Self { match err { - DeviceError::Lost => WebGPUError::Lost, - DeviceError::OutOfMemory => WebGPUError::OutOfMemory, - DeviceError::Invalid => WebGPUError::Validation(err.to_string()), + DeviceError::Lost => WebGpuError::Lost, + DeviceError::OutOfMemory => WebGpuError::OutOfMemory, + DeviceError::Invalid => WebGpuError::Validation(err.to_string()), } } } -impl From for WebGPUError { +impl From for WebGpuError { fn from(err: BufferAccessError) -> Self { match err { BufferAccessError::Device(err) => err.into(), - err => WebGPUError::Validation(err.to_string()), + err => WebGpuError::Validation(err.to_string()), } } } -impl From for WebGPUError { +impl From for WebGpuError { fn from(err: CreateBindGroupLayoutError) -> Self { match err { CreateBindGroupLayoutError::Device(err) => err.into(), - err => WebGPUError::Validation(err.to_string()), + err => WebGpuError::Validation(err.to_string()), } } } -impl From for WebGPUError { +impl From for WebGpuError { fn from(err: CreatePipelineLayoutError) -> Self { match err { CreatePipelineLayoutError::Device(err) => err.into(), - err => WebGPUError::Validation(err.to_string()), + err => WebGpuError::Validation(err.to_string()), } } } -impl From for WebGPUError { +impl From for WebGpuError { fn from(err: CreateBindGroupError) -> Self { match err { CreateBindGroupError::Device(err) => err.into(), - err => WebGPUError::Validation(err.to_string()), + err => WebGpuError::Validation(err.to_string()), } } } -impl From for WebGPUError { +impl From for WebGpuError { fn from(err: RenderBundleError) -> Self { - WebGPUError::Validation(err.to_string()) + WebGpuError::Validation(err.to_string()) } } -impl From for WebGPUError { +impl From for WebGpuError { fn from(err: CreateRenderBundleError) -> Self { - WebGPUError::Validation(err.to_string()) + WebGpuError::Validation(err.to_string()) } } -impl From for WebGPUError { +impl From for WebGpuError { fn from(err: CommandAllocatorError) -> Self { match err { CommandAllocatorError::Device(err) => err.into(), @@ -111,142 +111,142 @@ impl From for WebGPUError { } } -impl From for WebGPUError { +impl From for WebGpuError { fn from(err: CopyError) -> Self { - WebGPUError::Validation(err.to_string()) + WebGpuError::Validation(err.to_string()) } } -impl From for WebGPUError { +impl From for WebGpuError { fn from(err: CommandEncoderError) -> Self { - WebGPUError::Validation(err.to_string()) + WebGpuError::Validation(err.to_string()) } } -impl From for WebGPUError { +impl From for WebGpuError { fn from(err: QueryError) -> Self { - WebGPUError::Validation(err.to_string()) + WebGpuError::Validation(err.to_string()) } } -impl From for WebGPUError { +impl From for WebGpuError { fn from(err: ComputePassError) -> Self { - WebGPUError::Validation(err.to_string()) + WebGpuError::Validation(err.to_string()) } } -impl From for WebGPUError { +impl From for WebGpuError { fn from(err: CreateComputePipelineError) -> Self { match err { CreateComputePipelineError::Device(err) => err.into(), - err => WebGPUError::Validation(err.to_string()), + err => WebGpuError::Validation(err.to_string()), } } } -impl From for WebGPUError { +impl From for WebGpuError { fn from(err: GetBindGroupLayoutError) -> Self { - WebGPUError::Validation(err.to_string()) + WebGpuError::Validation(err.to_string()) } } -impl From for WebGPUError { +impl From for WebGpuError { fn from(err: CreateRenderPipelineError) -> Self { match err { CreateRenderPipelineError::Device(err) => err.into(), - err => WebGPUError::Validation(err.to_string()), + err => WebGpuError::Validation(err.to_string()), } } } -impl From for WebGPUError { +impl From for WebGpuError { fn from(err: RenderPassError) -> Self { - WebGPUError::Validation(err.to_string()) + WebGpuError::Validation(err.to_string()) } } -impl From for WebGPUError { +impl From for WebGpuError { fn from(err: CreateSamplerError) -> Self { match err { CreateSamplerError::Device(err) => err.into(), - err => WebGPUError::Validation(err.to_string()), + err => WebGpuError::Validation(err.to_string()), } } } -impl From for WebGPUError { +impl From for WebGpuError { fn from(err: CreateShaderModuleError) -> Self { match err { CreateShaderModuleError::Device(err) => err.into(), - err => WebGPUError::Validation(err.to_string()), + err => WebGpuError::Validation(err.to_string()), } } } -impl From for WebGPUError { +impl From for WebGpuError { fn from(err: CreateTextureError) -> Self { match err { CreateTextureError::Device(err) => err.into(), - err => WebGPUError::Validation(err.to_string()), + err => WebGpuError::Validation(err.to_string()), } } } -impl From for WebGPUError { +impl From for WebGpuError { fn from(err: CreateTextureViewError) -> Self { - WebGPUError::Validation(err.to_string()) + WebGpuError::Validation(err.to_string()) } } -impl From for WebGPUError { +impl From for WebGpuError { fn from(err: CreateQuerySetError) -> Self { match err { CreateQuerySetError::Device(err) => err.into(), - err => WebGPUError::Validation(err.to_string()), + err => WebGpuError::Validation(err.to_string()), } } } -impl From for WebGPUError { +impl From for WebGpuError { fn from(err: QueueSubmitError) -> Self { match err { QueueSubmitError::Queue(err) => err.into(), - err => WebGPUError::Validation(err.to_string()), + err => WebGpuError::Validation(err.to_string()), } } } -impl From for WebGPUError { +impl From for WebGpuError { fn from(err: QueueWriteError) -> Self { match err { QueueWriteError::Queue(err) => err.into(), - err => WebGPUError::Validation(err.to_string()), + err => WebGpuError::Validation(err.to_string()), } } } #[derive(Debug)] -pub struct DOMExceptionOperationError { +pub struct DomExceptionOperationError { pub msg: String, } -impl DOMExceptionOperationError { +impl DomExceptionOperationError { pub fn new(msg: &str) -> Self { - DOMExceptionOperationError { + DomExceptionOperationError { msg: msg.to_string(), } } } -impl fmt::Display for DOMExceptionOperationError { +impl fmt::Display for DomExceptionOperationError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.pad(&self.msg) } } -impl std::error::Error for DOMExceptionOperationError {} +impl std::error::Error for DomExceptionOperationError {} pub fn get_error_class_name(e: &AnyError) -> Option<&'static str> { - e.downcast_ref::() + e.downcast_ref::() .map(|_| "DOMExceptionOperationError") } -- cgit v1.2.3