Skip to main content

reinhardt_admin_cli/migrate_v2/
rewriter.rs

1//! Rewriter trait composed across rules.
2
3/// One mechanical migration step in the Manouche v1 → v2 codemod.
4///
5/// Each rule receives the parsed AST of a single `.rs` file and returns a
6/// (possibly) transformed copy. Rules are composed sequentially by the
7/// driver in `migrate_v2::run`.
8pub trait FileRewriter {
9	/// Returns a (possibly) transformed copy of the input file AST.
10	fn rewrite(&self, file: syn::File) -> syn::File;
11
12	/// Short name for `--skip` filtering and reporting.
13	fn name(&self) -> &'static str;
14}