chore(doc/context): clarify context finalization limit error message

This commit is contained in:
2025-10-28 00:10:22 -04:00
parent c8a3408fdd
commit 734ab84054

View File

@@ -168,13 +168,13 @@ impl SproutContext {
let mut current_values = self.all_values(); let mut current_values = self.all_values();
// To ensure that there is no possible infinite loop, we need to check // To ensure that there is no possible infinite loop, we need to check
// the number of iterations. If it exceeds 100, we bail. // the number of iterations. If it exceeds CONTEXT_FINALIZE_ITERATION_LIMIT, we bail.
let mut iterations: usize = 0; let mut iterations: usize = 0;
loop { loop {
iterations += 1; iterations += 1;
if iterations > CONTEXT_FINALIZE_ITERATION_LIMIT { if iterations > CONTEXT_FINALIZE_ITERATION_LIMIT {
bail!("infinite loop detected in context finalization"); bail!("maximum number of replacement iterations reached while finalizing context");
} }
let mut did_change = false; let mut did_change = false;