Dispatch a single `DiffOp` through the rule table. Walks `RULES` top-to-bottom; the first `matches` predicate that returns `true` selects the rule whose `apply` is invoked. When no rule matches (e.g., for `DiffOp::Replace`, which the inline recipe still handles), returns `false` so the caller knows it must fall back to its own translation logic. Returns `true` when a rule fired.
(op: &DiffOp, ctx: &mut DiffOpContext<'_>)
| 248 | /// |
| 249 | /// Returns `true` when a rule fired. |
| 250 | pub fn dispatch(op: &DiffOp, ctx: &mut DiffOpContext<'_>) -> bool { |
| 251 | for rule in RULES { |
| 252 | if (rule.matches)(op, ctx) { |
| 253 | log::trace!("diff_op_rules::dispatch: matched {}", rule.name); |
| 254 | (rule.apply)(op, ctx); |
| 255 | return true; |
| 256 | } |
| 257 | } |
| 258 | log::trace!("diff_op_rules::dispatch: no rule matched, caller handles"); |
| 259 | false |
| 260 | } |
| 261 | |
| 262 | // Post-pass rules |
| 263 |
no outgoing calls