From 606454eacb2cf20beb60c5507a8691e13f03e2fa Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Fri, 15 May 2026 21:33:36 +0800 Subject: Rename `set_instance_and_run` to `exec_wrapper` and remove doc comments --- mingling_core/src/program.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'mingling_core') diff --git a/mingling_core/src/program.rs b/mingling_core/src/program.rs index 0d8506a..f2809f7 100644 --- a/mingling_core/src/program.rs +++ b/mingling_core/src/program.rs @@ -175,8 +175,7 @@ impl Program where C: ProgramCollect, { - /// Sets the current program instance and runs the provided async function. - async fn set_instance_and_run(self, f: F) -> Fut::Output + async fn exec_wrapper(self, f: F) -> Fut::Output where C: 'static + Send + Sync, F: FnOnce(&'static Program) -> Fut + Send + Sync, @@ -199,7 +198,7 @@ where C: 'static + Send + Sync, { self.args = self.args.iter().skip(1).cloned().collect(); - self.set_instance_and_run(|p| async { crate::exec::exec(p).await.map_err(|e| e.into()) }) + self.exec_wrapper(|p| async { crate::exec::exec(p).await.map_err(|e| e.into()) }) .await } @@ -260,8 +259,7 @@ impl Program where C: ProgramCollect, { - /// Sets the current program instance and runs the provided function. - fn set_instance_and_run(self, f: F) -> R + fn exec_wrapper(self, f: F) -> R where C: 'static + Send + Sync, F: FnOnce(&'static Program) -> R + Send + Sync, @@ -283,7 +281,7 @@ where C: 'static + Send + Sync, { self.args = self.args.iter().skip(1).cloned().collect(); - self.set_instance_and_run(|p| crate::exec::exec(p).map_err(|e| e.into())) + self.exec_wrapper(|p| crate::exec::exec(p).map_err(|e| e.into())) } /// Run the command line program -- cgit