Skip to content

Commit

Permalink
feat(router): Make Routes::prepare public
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto committed May 21, 2024
1 parent e3ab9a7 commit ab3dbc3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tonic/src/service/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ impl Routes {
self
}

#[cfg(feature = "transport")]
pub(crate) fn prepare(self) -> Self {
/// This makes axum perform update some internals of the router that improves perf.
///
/// See <https://docs.rs/axum/latest/axum/routing/struct.Router.html#a-note-about-performance>
pub fn prepare(self) -> Self {
Self {
// this makes axum perform update some internals of the router that improves perf
// see https://docs.rs/axum/latest/axum/routing/struct.Router.html#a-note-about-performance
router: self.router.with_state(()),
}
}
Expand Down

0 comments on commit ab3dbc3

Please sign in to comment.