Skip to main content

FileRewriter

Trait FileRewriter 

Source
pub trait FileRewriter {
    // Required methods
    fn rewrite(&self, file: File) -> File;
    fn name(&self) -> &'static str;
}
Expand description

One mechanical migration step in the Manouche v1 → v2 codemod.

Each rule receives the parsed AST of a single .rs file and returns a (possibly) transformed copy. Rules are composed sequentially by the driver in migrate_v2::run.

Required Methods§

Source

fn rewrite(&self, file: File) -> File

Returns a (possibly) transformed copy of the input file AST.

Source

fn name(&self) -> &'static str

Short name for --skip filtering and reporting.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl FileRewriter for reinhardt_admin_cli::migrate_v2::rules::bare_ident::Rule

Source§

impl FileRewriter for reinhardt_admin_cli::migrate_v2::rules::component_props::Rule

Source§

impl FileRewriter for reinhardt_admin_cli::migrate_v2::rules::use_effect_deps::Rule

Source§

impl FileRewriter for reinhardt_admin_cli::migrate_v2::rules::watch_unwrap::Rule