From f5a4cebde2f12eb980de73ea41eb8d9e133ae49a Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sat, 18 Jul 2026 01:53:59 +0800 Subject: ix(macros)!: require explicit `.into()` on chain function return values --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 50c66c6..f67e6d4 100644 --- a/README.md +++ b/README.md @@ -166,7 +166,7 @@ fn handle_greet(args: EntryGreet) -> Next { .first() .cloned() .unwrap_or_else(|| "World".to_string()); - ResultGreeting::new(greeting) + ResultGreeting::new(greeting).into() } ``` @@ -234,7 +234,7 @@ fn handle_greet(args: EntryGreet) -> Next { .pick::(()) // positional: first string .pick_or::(["-r", "--repeat"], 1) // optional flag with default .unpack(); - ResultGreeting::new(format!("{} x{}", name, count)) + ResultGreeting::new(format!("{} x{}", name, count)).into() } ``` @@ -252,7 +252,7 @@ fn handle(args: EntryGreet) -> Next { .pick::>(()) .pick_or::(["-r", "--repeat"], 1) .unpack(); - ResultGreeting::new(format!("{} x{}", name.unwrap_or_default(), count)) + ResultGreeting::new(format!("{} x{}", name.unwrap_or_default(), count)).into() } ``` @@ -279,7 +279,7 @@ impl PickableEnum for Language {} #[chain] fn handle(args: EntryLang) -> Next { let lang: Language = args.pick(()).unpack(); - lang + lang.into() } ``` @@ -781,7 +781,7 @@ pack!(ResultDownloaded = String); #[chain] pub async fn handle_download(args: EntryDownload) -> Next { let file = args.pick(()).unpack(); - download_file(file).await + download_file(file).await.into() } async fn download_file(name: String) -> ResultDownloaded { @@ -843,7 +843,7 @@ fn handle_greet(args: EntryGreet) -> Next { .first() .cloned() .unwrap_or_else(|| "World".to_string()); - ResultGreeting::new(greeting) + ResultGreeting::new(greeting).into() } #[renderer] -- cgit