Refactor Engine dispatch match arms with a single macro#309
Conversation
Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/4a4eb25c-d72d-4d59-b818-009975c5d73a Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
|
/rust-review |
|
✅ Rust PR Reviewer completed successfully! |
🔍 Rust PR ReviewSummary: Functionally correct, but the macro design creates a maintenance trap that makes future engine expansion harder, not easier — contrary to the stated goal. Findings
|
|
Yes agree |
PR #307 identified repetitive
Engine::Copilotmatch arms insrc/engine.rsthat were good candidates for further consolidation. This change applies a macro-based dispatch pattern to reduce duplication while keeping behavior and public APIs unchanged.Dispatch consolidation
dispatch_engine!macro that centralizes enum-variant dispatch forEngine.match self { Engine::Copilot => ... }blocks.Methods refactored to macro dispatch
commandargsenvlog_dirrequired_hostsinstall_stepsinvocationMaintenance impact