Skip to content

Commit

Permalink
feat(router): Rename Routes::into_router with into_axum_router (#1862)
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto authored Aug 8, 2024
1 parent d42daaf commit 6aa3cd6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
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

0 comments on commit 6aa3cd6

Please sign in to comment.