Expand description
split-modules: split large Rust source files into one-item-per-file submodules,
preserving comments and the public API, with the compiler as the safety net.
See split_file and split_project for the entry points.
Modules§
- apply
- Write a
SplitPlanto disk with a snapshot that supports full rollback. - classify
- Classify each top-level item: keep it in the parent, or move it to a child module file (with the visibility rewrites + re-export needed to preserve the API).
- model
- Core data types shared across the split pipeline.
- pathfix
- Rewrite module-relative paths inside an item that moves one level deeper.
- plan
- Build a
SplitPlanfrom a single source file: parse, classify, slice, group, and render both the child files’ item sources and the rewritten parent. - project
- Recursive project mode: find
.rsfiles that violate the one-item-per-file rule. - util
- Small pure helpers: identifier casing, keyword handling, and comment scanning.
- verify
- Compiler-based verification: locate the crate manifest and run
cargo check.
Structs§
- Crate
Ctx - Shared per-crate context resolved once (manifest dir, edition, baseline build state).
Functions§
- detect_
edition - Read
edition = "20xx"from a crate manifest (best effort, no TOML dependency). - split_
file - Split a single file (resolves its own crate context).
- split_
file_ with - Split a single file, using the supplied crate context.
- split_
project - Split every eligible file under
root(a file or directory).