diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-07-21 03:58:44 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-07-21 03:58:44 +0800 |
| commit | a3b75b7eeae5e7a0c53b6167bafb75a85fa6d9ce (patch) | |
| tree | 26219f710a5cac52b257f330bcfa29d3b6cae312 /mingling_core/src/program/setup.rs | |
| parent | 57746fc1512400fde467d3ccac4589915341416c (diff) | |
feat(core): return `&mut Self` from builder methods
Enables method chaining for `with_resource`, `with_dispatcher`,
`with_dispatchers`, `with_hook`, and `with_setup`
Diffstat (limited to 'mingling_core/src/program/setup.rs')
| -rw-r--r-- | mingling_core/src/program/setup.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mingling_core/src/program/setup.rs b/mingling_core/src/program/setup.rs index 838c29a..a8ff114 100644 --- a/mingling_core/src/program/setup.rs +++ b/mingling_core/src/program/setup.rs @@ -29,8 +29,9 @@ where C: ProgramCollect<Enum = C>, { /// Load and execute init logic - pub fn with_setup<S: ProgramSetup<C> + 'static>(&mut self, setup: S) { + pub fn with_setup<S: ProgramSetup<C> + 'static>(&mut self, setup: S) -> &mut Self { S::setup(setup, self); + self } } |
