diff options
| author | Weicao-CatilGrass <1992414357@qq.com> | 2026-05-31 02:42:52 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-05-31 17:19:20 +0800 |
| commit | 2aa7bda3cb21ce6c052b82e08bcab79a625d04f2 (patch) | |
| tree | f10b89007fc67ca1a948f34abe6869b49296b932 /examples/example-hook | |
| parent | 3aa409a55e4f2f0ab41b0949cc06eb13c2da4a43 (diff) | |
Enhance code quality across the entire codebase
Diffstat (limited to 'examples/example-hook')
| -rw-r--r-- | examples/example-hook/src/main.rs | 9 |
1 files changed, 5 insertions, 4 deletions
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::<ThisProgram>::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); |
