From df7a6defa821457e096c254ac2532891ae9bfe75 Mon Sep 17 00:00:00 2001 From: teoxoy <28601907+teoxoy@users.noreply.github.com> Date: Fri, 28 Jun 2024 19:14:37 +0200 Subject: [PATCH] don't print the scope twice The scope is already printed by the Display impl of those errors. --- wgpu-core/src/command/bundle.rs | 11 ++--------- wgpu-core/src/command/compute.rs | 11 ++--------- wgpu-core/src/command/render.rs | 11 ++--------- 3 files changed, 6 insertions(+), 27 deletions(-) diff --git a/wgpu-core/src/command/bundle.rs b/wgpu-core/src/command/bundle.rs index cf4fbcda7..43c075234 100644 --- a/wgpu-core/src/command/bundle.rs +++ b/wgpu-core/src/command/bundle.rs @@ -89,7 +89,7 @@ use crate::{ AttachmentData, Device, DeviceError, MissingDownlevelFlags, RenderPassContext, SHADER_STAGE_COUNT, }, - error::{ErrorFormatter, PrettyError}, + error::PrettyError, hal_api::HalApi, hub::Hub, id, @@ -1593,14 +1593,7 @@ impl RenderBundleError { } } } -impl PrettyError for RenderBundleError { - fn fmt_pretty(&self, fmt: &mut ErrorFormatter) { - // This error is wrapper for the inner error, - // but the scope has useful labels - fmt.error(self); - self.scope.fmt_pretty(fmt); - } -} +impl PrettyError for RenderBundleError {} impl MapPassErr for Result where diff --git a/wgpu-core/src/command/compute.rs b/wgpu-core/src/command/compute.rs index 485960e1c..bce44ae25 100644 --- a/wgpu-core/src/command/compute.rs +++ b/wgpu-core/src/command/compute.rs @@ -12,7 +12,7 @@ use crate::{ PassErrorScope, PassTimestampWrites, QueryUseError, StateChange, }, device::{Device, DeviceError, MissingDownlevelFlags, MissingFeatures}, - error::{ErrorFormatter, PrettyError}, + error::PrettyError, global::Global, hal_api::HalApi, hal_label, id, @@ -192,14 +192,7 @@ pub struct ComputePassError { #[source] pub(super) inner: ComputePassErrorInner, } -impl PrettyError for ComputePassError { - fn fmt_pretty(&self, fmt: &mut ErrorFormatter) { - // This error is wrapper for the inner error, - // but the scope has useful labels - fmt.error(self); - self.scope.fmt_pretty(fmt); - } -} +impl PrettyError for ComputePassError {} impl MapPassErr for Result where diff --git a/wgpu-core/src/command/render.rs b/wgpu-core/src/command/render.rs index 04760d9ae..3c806756e 100644 --- a/wgpu-core/src/command/render.rs +++ b/wgpu-core/src/command/render.rs @@ -20,7 +20,7 @@ use crate::{ AttachmentData, Device, DeviceError, MissingDownlevelFlags, MissingFeatures, RenderPassCompatibilityError, RenderPassContext, }, - error::{ErrorFormatter, PrettyError}, + error::PrettyError, global::Global, hal_api::HalApi, hal_label, id, @@ -738,14 +738,7 @@ pub struct RenderPassError { #[source] pub(super) inner: RenderPassErrorInner, } -impl PrettyError for RenderPassError { - fn fmt_pretty(&self, fmt: &mut ErrorFormatter) { - // This error is wrapper for the inner error, - // but the scope has useful labels - fmt.error(self); - self.scope.fmt_pretty(fmt); - } -} +impl PrettyError for RenderPassError {} impl MapPassErr for Result where