summaryrefslogtreecommitdiff
path: root/mingling_core/src
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-04-01 16:40:44 +0800
committer魏曹先生 <1992414357@qq.com>2026-04-01 16:40:44 +0800
commit2a841ecd57d1d3d1c187f220c599164a2c6fc1cc (patch)
treef1b7f293c7819619106f03a7371fc03a956b5ec2 /mingling_core/src
parent0cb8ccca6e4fc2b433f6a2492b2cdfd96751ca40 (diff)
Add early exit for renderer not found in execution loop
Diffstat (limited to 'mingling_core/src')
-rw-r--r--mingling_core/src/program/exec.rs9
1 files changed, 9 insertions, 0 deletions
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(&current) {
@@ -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.