From 2a841ecd57d1d3d1c187f220c599164a2c6fc1cc Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Wed, 1 Apr 2026 16:40:44 +0800 Subject: Add early exit for renderer not found in execution loop --- mingling_core/src/program/exec.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mingling_core/src/program/exec.rs b/mingling_core/src/program/exec.rs index bf025fd..7de3723 100644 --- a/mingling_core/src/program/exec.rs +++ b/mingling_core/src/program/exec.rs @@ -15,6 +15,7 @@ where G: Display, { let mut current; + let mut stop_next = false; // Match user input match match_user_input(&program) { @@ -34,6 +35,8 @@ where }; loop { + let final_exec = stop_next; + current = { // If a chain exists, execute as a chain if C::has_chain(¤t) { @@ -51,10 +54,16 @@ where } // No renderer exists else { + stop_next = true; C::build_renderer_not_found(current.member_id) } }; + + if final_exec && stop_next { + break; + } } + Ok(RenderResult::default()) } /// Match user input against registered dispatchers and return the matched dispatcher and remaining arguments. -- cgit