From 4c76ea7a5a11c3b7eb609196d4aee5d1bfb01cf6 Mon Sep 17 00:00:00 2001 From: Zachary Harrold Date: Thu, 10 Oct 2024 01:20:16 +1100 Subject: [PATCH] Remove `thiserror` from `bevy_core_pipeline` (#15775) # Objective - Contributes to #15460 ## Solution - Removed `thiserror` from `bevy_core_pipeline` --- crates/bevy_core_pipeline/Cargo.toml | 6 +++++- .../src/auto_exposure/compensation_curve.rs | 10 +++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/crates/bevy_core_pipeline/Cargo.toml b/crates/bevy_core_pipeline/Cargo.toml index e134f702ca..31d37eeead 100644 --- a/crates/bevy_core_pipeline/Cargo.toml +++ b/crates/bevy_core_pipeline/Cargo.toml @@ -41,7 +41,11 @@ bitflags = "2.3" radsort = "0.1" nonmax = "0.5" smallvec = "1" -thiserror = "1.0" +derive_more = { version = "1", default-features = false, features = [ + "error", + "from", + "display", +] } [lints] workspace = true diff --git a/crates/bevy_core_pipeline/src/auto_exposure/compensation_curve.rs b/crates/bevy_core_pipeline/src/auto_exposure/compensation_curve.rs index 67dcead57a..3c64152063 100644 --- a/crates/bevy_core_pipeline/src/auto_exposure/compensation_curve.rs +++ b/crates/bevy_core_pipeline/src/auto_exposure/compensation_curve.rs @@ -10,7 +10,7 @@ use bevy_render::{ }, renderer::{RenderDevice, RenderQueue}, }; -use thiserror::Error; +use derive_more::derive::{Display, Error}; const LUT_SIZE: usize = 256; @@ -40,16 +40,16 @@ pub struct AutoExposureCompensationCurve { } /// Various errors that can occur when constructing an [`AutoExposureCompensationCurve`]. -#[derive(Error, Debug)] +#[derive(Error, Display, Debug)] pub enum AutoExposureCompensationCurveError { /// The curve couldn't be built in the first place. - #[error("curve could not be constructed from the given data")] + #[display("curve could not be constructed from the given data")] InvalidCurve, /// A discontinuity was found in the curve. - #[error("discontinuity found between curve segments")] + #[display("discontinuity found between curve segments")] DiscontinuityFound, /// The curve is not monotonically increasing on the x-axis. - #[error("curve is not monotonically increasing on the x-axis")] + #[display("curve is not monotonically increasing on the x-axis")] NotMonotonic, }