axum-0-7-to-0-8
Automate the highest-value deterministic part of the Rust axum migration from v0.7 to v0.8.
What it does
Route path syntax updates
/:id->/{id}/*rest->/{*rest}- Rewrites path strings passed to:
.route(...).route_service(...).nest(...).nest_service(...)
- Supports normal Rust string literals and raw string literals used in those route definitions
Cargo.toml follow-up
- Update
axum = "0.7.x"->axum = "0.8" - Update
axum = { version = "0.7.x", ... }->axum = { version = "0.8", ... }
Usage
bash
Manual follow-up
After running, you should:
- Review
Cargo.tomlupdates for uncommon axum dependency formatting not covered by deterministic rewrites - Review custom route strings outside
.route,.route_service,.nest, and.nest_service - Check code using
Option<Path<T>>or other optional extractors for behavior changes in axum 0.8 - Review custom
FromRequestandFromRequestPartsimplementations if they rely on#[async_trait] - Run
cargo checkandcargo test
Development
bash
References
- https://tokio.rs/blog/2025-01-01-announcing-axum-0-8-0
- https://docs.rs/crate/axum/0.8.8/source/CHANGELOG.md
License
MIT