Apply suggestions from code review

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
This commit is contained in:
David Pedersen 2022-06-30 00:26:49 +02:00 committed by GitHub
parent 657a0893b5
commit bbf1852c56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -106,15 +106,15 @@ async fn fallback() {}
let app = Router::new()
.nest("/api", nested_router)
.nest_service("/assets", nested_service)
// the fallback is not called for request starting with `/bar` but will be
// called for requests starting with `/foo` if `nested_router` doesn't have
// the fallback is not called for request starting with `/assets` but will be
// called for requests starting with `/api` if `nested_router` doesn't have
// a matching route
.fallback(fallback.into_service());
# let _: Router = app;
```
Note that you would normally use [`tower_http::services::ServeDir`] for serving
static files and thus not calling `nest_service` with a `Router`.
static files and thus not call `nest_service` with a `Router`.
# Panics