Expand description
Conservative text-level edits to wire generated code into the existing builder chains.
Why not syn? Re-emitting Rust through syn + prettyplease loses
formatting, comments, and blank-line layout — adopters then see a
surprise diff every time they generate something. So this module
takes a narrower approach: find a known anchor substring, insert
one line, leave everything else alone.
The patterns we match are the exact ones the new scaffold emits
plus what the users-api example demonstrates. Anything more
creative (extracted-helper bootstrap, custom builder wrapper) is
out of scope — the callers fall back to printing the manual hint.
Enums§
- Register
Outcome - Result of one auto-register attempt. The wrapping caller turns these into print lines.
Functions§
- insert_
chain_ call_ after_ anchor - Insert
new_call(a builder method like.module(modules::posts::define())) intocontentsat the right indentation, anchored to the last line containinganchor_substring. - insert_
use_ after_ last_ use - Insert a
use ...;line just after the last existinguse ...;line at the top of the file. Returns true if inserted, false if nouselines were found.