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 Jun 2, 2024
1 parent 6ba5ade commit 4a3490b
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 4a3490b

Please sign in to comment.