From 2aa7bda3cb21ce6c052b82e08bcab79a625d04f2 Mon Sep 17 00:00:00 2001 From: Weicao-CatilGrass <1992414357@qq.com> Date: Sun, 31 May 2026 02:42:52 +0800 Subject: Enhance code quality across the entire codebase --- examples/example-hook/src/main.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'examples/example-hook/src/main.rs') diff --git a/examples/example-hook/src/main.rs b/examples/example-hook/src/main.rs index 373c76d..d6a2dd0 100644 --- a/examples/example-hook/src/main.rs +++ b/examples/example-hook/src/main.rs @@ -31,17 +31,17 @@ fn main() { program.with_hook( ProgramHook::::empty() .on_begin(|| println!("[DEBUG] Program is begin")) - .on_pre_dispatch(|args| println!("[DEBUG] Pre dispatch: {:?}", args)) - .on_post_dispatch(|c: &_| println!("[DEBUG] Post dispatch: {:?}", c)) + .on_pre_dispatch(|args| println!("[DEBUG] Pre dispatch: {args:?}")) + .on_post_dispatch(|c: &_| println!("[DEBUG] Post dispatch: {c:?}")) .on_pre_chain(|c: &_, _| { - println!("[DEBUG] Pre chain: {}", c); + println!("[DEBUG] Pre chain: {c}"); }) .on_post_chain(|any_output| println!("[DEBUG] Post chain: {}", any_output.member_id)) .on_finish(|| { println!("[DEBUG] Loop end"); 0 // Override exit code }) - .on_pre_render(|c: &_, _| println!("[DEBUG] Pre render: {}", c)) + .on_pre_render(|c: &_, _| println!("[DEBUG] Pre render: {c}")) .on_post_render(|_| println!("[DEBUG] Post render")), ); // --------- IMPORTANT --------- @@ -63,6 +63,7 @@ fn handle_greet(args: EntryGreet) -> Next { name } +/// Renders the greeting message with the provided name. #[renderer] fn render_name(name: ResultName) { r_println!("Hello, {}!", *name); -- cgit