| Crates.io | cargo-hilly |
| lib.rs | cargo-hilly |
| version | 0.1.1 |
| created_at | 2025-07-01 16:32:45.812498+00 |
| updated_at | 2025-08-10 12:03:57.887597+00 |
| description | Utility for Rust projects that helps migrate flat module files (e.g., "foo.rs") into the more idiomatic Rust module layout. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1733389 |
| size | 15,587 |
cargo-hilly is a utility for Rust projects that helps migrate flat module files (e.g., "foo.rs") into the more idiomatic Rust module layout using subdirectories with mod.rs (e.g., "foo/mod.rs"). It scans your workspace for Rust crates and identifies modules that can be moved to this structure, then performs the migration for you.
I don't like the new way of organizing the modules. It's hard to go through a complex project when you need to go in the parent directory to find a file related to the current module.
Run the tool from the root of your workspace:
cargo install cargo-hilly
By default, it will migrate all eligible modules and print the actions taken.
--dry-run:
Shows what would be migrated without making any changes. Useful for previewing the migration.
cargo hilly --dry-run
--check:
Checks if there are modules that need to be migrated. Exits with a non-zero status if migration is needed, but does not make any changes. Implies dry-run.
cargo hilly --check
Suppose you have:
src/
foo.rs
foo/
bar.rs
After running cargo-hilly, if src/foo/mod.rs does not exist, foo.rs will be moved to foo/mod.rs.
MIT