Skip to content

Commit 4a3490b

Browse files
committed
feat(router): Make Routes::prepare public
1 parent 6ba5ade commit 4a3490b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tonic/src/service/router.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ impl Routes {
8383
self
8484
}
8585

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

0 commit comments

Comments
 (0)