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

feat(router): Rename Routes::into_router with into_axum_router #1862

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tonic/src/service/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,13 @@ impl Routes {
}

/// Convert this `Routes` into an [`axum::Router`].
#[deprecated(since = "0.12.2", note = "Use `Routes::into_axum_router` instead.")]
pub fn into_router(self) -> axum::Router {
self.into_axum_router()
}

/// Convert this `Routes` into an [`axum::Router`].
pub fn into_axum_router(self) -> axum::Router {
self.router
}
}
Expand Down
4 changes: 2 additions & 2 deletions tonic/src/transport/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -709,9 +709,9 @@ impl<L> Router<L> {
}

/// Convert this tonic `Router` into an axum `Router` consuming the tonic one.
#[deprecated(since = "0.12.2", note = "Use `Routes::into_router` instead.")]
#[deprecated(since = "0.12.2", note = "Use `Routes::into_axum_router` instead.")]
pub fn into_router(self) -> axum::Router {
self.routes.into_router()
self.routes.into_axum_router()
}

/// Consume this [`Server`] creating a future that will execute the server
Expand Down