Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): Clarify nested router fallbacks in CHANGELOG.md #1581

Merged
merged 1 commit into from Nov 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions axum/CHANGELOG.md
Expand Up @@ -24,7 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
// this would panic in 0.5 but in 0.6 it just works
//
// requests starting with `/api` but not handled by `api_router`
// will go to `/api_fallback`
// will go to `api_fallback`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reasoning:

  • api_fallback is a handler, not a path.

.nest("/api", api_router);
```

Expand All @@ -37,7 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

let app = Router::new()
.nest("/api", api_router)
// `api_fallback` will inherit this fallback
// `api_router` will inherit this fallback
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reasoning:

  • api_fallback does not exist here.
  • The Router api_router inherits the app_fallback handler as fallback.

.fallback(app_fallback);
```

Expand Down