Document breaking changes related to nest (#1684)

This commit is contained in:
David Pedersen 2023-01-07 19:06:59 +01:00 committed by GitHub
parent 1aa357c879
commit be9a8c0380
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -158,6 +158,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
async fn fallback() {}
```
- **breaking:** It is no longer supported to `nest` twice at the same path, i.e.
`.nest("/foo", a).nest("/foo", b)` will panic. Instead use `.nest("/foo", a.merge(b))`
- **breaking:** It is no longer supported to `nest` a router and add a route at
the same path, such as `.nest("/a", _).route("/a", _)`. Instead use
`.nest("/a/", _).route("/a", _)`.
- **changed:** `Router::nest` now only accepts `Router`s, the general-purpose
`Service` nesting method has been renamed to `nest_service` ([#1368])
- **breaking:** Allow `Error: Into<Infallible>` for `Route::{layer, route_layer}` ([#924])