We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 830a114 commit c10934cCopy full SHA for c10934c
axum/src/routing/mod.rs
@@ -605,7 +605,7 @@ where
605
/// See [`Router::as_service`] for more details.
606
pub struct RouterAsService<'a, B, S = ()> {
607
router: &'a mut Router<S>,
608
- _marker: PhantomData<B>,
+ _marker: PhantomData<fn(B)>,
609
}
610
611
impl<B> Service<Request<B>> for RouterAsService<'_, B, ()>
@@ -644,7 +644,7 @@ where
644
/// See [`Router::into_service`] for more details.
645
pub struct RouterIntoService<B, S = ()> {
646
router: Router<S>,
647
648
649
650
impl<B, S> Clone for RouterIntoService<B, S>
@@ -812,4 +812,8 @@ fn traits() {
812
use crate::test_helpers::*;
813
assert_send::<Router<()>>();
814
assert_sync::<Router<()>>();
815
+ assert_send::<RouterAsService<'static, Body, ()>>();
816
+ assert_sync::<RouterAsService<'static, Body, ()>>();
817
+ assert_send::<RouterIntoService<Body, ()>>();
818
+ assert_sync::<RouterIntoService<Body, ()>>();
819
axum/src/serve/mod.rs
@@ -121,7 +121,7 @@ where
121
pub struct Serve<L, M, S, B> {
122
listener: L,
123
make_service: M,
124
- _marker: PhantomData<(S, B)>,
+ _marker: PhantomData<fn(B) -> S>,
125
126
127
#[cfg(all(feature = "tokio", any(feature = "http1", feature = "http2")))]
@@ -252,7 +252,7 @@ pub struct WithGracefulShutdown<L, M, S, F, B> {
252
253
254
signal: F,
255
256
257
258
0 commit comments