From db9afa0b06355028eafe3bc29fe0b2429ba8fd0a Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sun, 29 Mar 2026 00:52:16 +0800 Subject: Completed the first preliminary usable version of the Mingling framework. --- mingling/src/program/setup.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'mingling/src/program/setup.rs') diff --git a/mingling/src/program/setup.rs b/mingling/src/program/setup.rs index fdf7b04..e81247e 100644 --- a/mingling/src/program/setup.rs +++ b/mingling/src/program/setup.rs @@ -1,15 +1,19 @@ -use crate::program::Program; +use crate::{ProgramCollect, program::Program}; mod basic; pub use basic::*; -pub trait ProgramSetup { - fn setup(program: &mut Program); +pub trait ProgramSetup { + fn setup(&mut self, program: &mut Program); } -impl Program { +impl Program +where + C: ProgramCollect, +{ /// Load and execute init logic - pub fn with_setup(&mut self, _setup: S) { - S::setup(self); + pub fn with_setup + 'static>(&mut self, mut setup: S) -> S { + S::setup(&mut setup, self); + setup } } -- cgit