From 532f4ceba2bddb1c84d2e0bdd69808a3ebd5ca4a Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sun, 19 Apr 2026 00:31:05 +0800 Subject: Make async an optional feature --- examples/example-basic/src/main.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'examples/example-basic/src') diff --git a/examples/example-basic/src/main.rs b/examples/example-basic/src/main.rs index 9aaff06..a35cac6 100644 --- a/examples/example-basic/src/main.rs +++ b/examples/example-basic/src/main.rs @@ -13,8 +13,7 @@ use mingling::{ // Define dispatcher `HelloCommand`, directing subcommand "hello" to `HelloEntry` dispatcher!("hello", HelloCommand => HelloEntry); -#[tokio::main] -async fn main() { +fn main() { // Create program let mut program = ThisProgram::new(); @@ -22,7 +21,7 @@ async fn main() { program.with_dispatcher(HelloCommand); // Run program - program.exec().await; + program.exec(); } // Register wrapper type `Hello`, setting inner to `String` @@ -30,7 +29,7 @@ pack!(Hello = String); // Register chain to `ThisProgram`, handling logic from `HelloEntry` #[chain] -async fn parse_name(prev: HelloEntry) -> NextProcess { +fn parse_name(prev: HelloEntry) -> NextProcess { // Extract string from `HelloEntry` as argument let name = prev.first().cloned().unwrap_or_else(|| "World".to_string()); -- cgit