Show HN: Rust-reorder – a CLI tool for reordering top-level items in Rust source
1 points| soletta | 4 days ago |github.com
When an agent needs to move a struct above its impl block, or group related functions together, it has to delete and re-insert lines — tracking whitespace, comments, attributes, and hoping nothing gets lost.
rust-reorder parses the file with syn, assigns ordinals to every top-level item, and lets you move or reorder them. Comments and doc attributes travel with their items. A safety check verifies no non-empty lines were lost or duplicated.
Three commands: `list` (shows items with ordinals), `move` (relocate one item before/after another), `order` (full reorder by ordinal sequence).
Works fine for humans too, but the real use case is giving agents a reliable primitive for code organization.
No comments yet.