From 1ab19e8765ea2ed62c8a41113d84867facaabf08 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 1 Jun 2026 12:55:23 +0800 Subject: Change `ProgramSetup::setup` to consume `self` instead of borrow --- mingling_core/src/program/setup.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'mingling_core/src') diff --git a/mingling_core/src/program/setup.rs b/mingling_core/src/program/setup.rs index 0fe8070..fa9d0eb 100644 --- a/mingling_core/src/program/setup.rs +++ b/mingling_core/src/program/setup.rs @@ -4,7 +4,7 @@ pub trait ProgramSetup where C: ProgramCollect, { - fn setup(&mut self, program: &mut Program); + fn setup(self, program: &mut Program); } impl Program @@ -12,8 +12,7 @@ where C: ProgramCollect, { /// Load and execute init logic - pub fn with_setup + 'static>(&mut self, mut setup: S) -> S { - S::setup(&mut setup, self); - setup + pub fn with_setup + 'static>(&mut self, setup: S) { + S::setup(setup, self); } } -- cgit