From 95c6b979ca399671eed8bf9c72f53cfe5d46f431 Mon Sep 17 00:00:00 2001 From: Weicao-CatilGrass <1992414357@qq.com> Date: Wed, 13 May 2026 07:28:02 +0800 Subject: Migrate exit code control to resource-based system --- mingling_core/src/program.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'mingling_core/src/program.rs') diff --git a/mingling_core/src/program.rs b/mingling_core/src/program.rs index b8a409e..0d8506a 100644 --- a/mingling_core/src/program.rs +++ b/mingling_core/src/program.rs @@ -11,11 +11,10 @@ use crate::{ AnyOutput, ChainProcess, GlobalResources, Groupped, RenderResult, asset::dispatcher::Dispatcher, error::{ChainProcessError, ProgramExecuteError}, - hook::{ProgramAnonymousHook, ProgramHook}, + hook::ProgramHook, }; use std::{ collections::HashMap, - fmt::Display, sync::{Arc, Mutex, OnceLock}, }; @@ -77,7 +76,6 @@ where pub general_renderer_name: GeneralRendererSetting, pub(crate) hooks: Vec>, - pub(crate) anonymous_hooks: Vec, pub(crate) resources: GlobalResources, } @@ -120,7 +118,6 @@ where general_renderer_name: GeneralRendererSetting::Disable, hooks: Vec::new(), - anonymous_hooks: Vec::new(), resources: Arc::new(Mutex::new(HashMap::new())), } @@ -176,7 +173,7 @@ where #[cfg(feature = "async")] impl Program where - C: ProgramCollect + std::fmt::Display, + C: ProgramCollect, { /// Sets the current program instance and runs the provided async function. async fn set_instance_and_run(self, f: F) -> Fut::Output @@ -261,7 +258,7 @@ where #[cfg(not(feature = "async"))] impl Program where - C: ProgramCollect + Display, + C: ProgramCollect, { /// Sets the current program instance and runs the provided function. fn set_instance_and_run(self, f: F) -> R @@ -345,7 +342,7 @@ where /// Note: It is recommended to use the `gen_program!()` macro from [mingling_macros](https://crates.io/crates/mingling_macros) to automatically create this type pub trait ProgramCollect { /// Enum type representing internal IDs for the program - type Enum: Display; + type Enum; type DispatcherNotFound: Groupped; type RendererNotFound: Groupped; -- cgit