From 1be0ed33fc68d4ab93b72f38510c1663ea3c46ad Mon Sep 17 00:00:00 2001 From: Zachary Harrold Date: Thu, 10 Oct 2024 01:17:52 +1100 Subject: [PATCH] Remove `thiserror` from `bevy_app` (#15779) # Objective - Contributes to #15460 ## Solution - Removed `thiserror` from `bevy_app` --- crates/bevy_app/Cargo.toml | 6 +++++- crates/bevy_app/src/app.rs | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/bevy_app/Cargo.toml b/crates/bevy_app/Cargo.toml index 758654b656..9f02f25554 100644 --- a/crates/bevy_app/Cargo.toml +++ b/crates/bevy_app/Cargo.toml @@ -29,7 +29,11 @@ bevy_tasks = { path = "../bevy_tasks", version = "0.15.0-dev" } # other downcast-rs = "1.2.0" -thiserror = "1.0" +derive_more = { version = "1", default-features = false, features = [ + "error", + "from", + "display", +] } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] ctrlc = "3.4.4" diff --git a/crates/bevy_app/src/app.rs b/crates/bevy_app/src/app.rs index 33d42b3cb8..e9852d90f1 100644 --- a/crates/bevy_app/src/app.rs +++ b/crates/bevy_app/src/app.rs @@ -15,11 +15,11 @@ use bevy_ecs::{ use bevy_utils::tracing::info_span; use bevy_utils::{tracing::debug, HashMap}; use core::{fmt::Debug, num::NonZero, panic::AssertUnwindSafe}; +use derive_more::derive::{Display, Error}; use std::{ panic::{catch_unwind, resume_unwind}, process::{ExitCode, Termination}, }; -use thiserror::Error; bevy_ecs::define_label!( /// A strongly-typed class of labels used to identify an [`App`]. @@ -32,9 +32,9 @@ pub use bevy_ecs::label::DynEq; /// A shorthand for `Interned`. pub type InternedAppLabel = Interned; -#[derive(Debug, Error)] +#[derive(Debug, Error, Display)] pub(crate) enum AppError { - #[error("duplicate plugin {plugin_name:?}")] + #[display("duplicate plugin {plugin_name:?}")] DuplicatePlugin { plugin_name: String }, }