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 a05920c commit 4fc3faaCopy full SHA for 4fc3faa
axum/src/routing/mod.rs
@@ -592,7 +592,7 @@ where
592
/// See [`Router::as_service`] for more details.
593
pub struct RouterAsService<'a, B, S = ()> {
594
router: &'a mut Router<S>,
595
- _marker: PhantomData<B>,
+ _marker: PhantomData<fn(B)>,
596
}
597
598
impl<B> Service<Request<B>> for RouterAsService<'_, B, ()>
@@ -631,7 +631,7 @@ where
631
/// See [`Router::into_service`] for more details.
632
pub struct RouterIntoService<B, S = ()> {
633
router: Router<S>,
634
635
636
637
impl<B, S> Clone for RouterIntoService<B, S>
@@ -800,4 +800,8 @@ fn traits() {
800
use crate::test_helpers::*;
801
assert_send::<Router<()>>();
802
assert_sync::<Router<()>>();
803
+ assert_send::<RouterAsService<'static, Body, ()>>();
804
+ assert_sync::<RouterAsService<'static, Body, ()>>();
805
+ assert_send::<RouterIntoService<Body, ()>>();
806
+ assert_sync::<RouterIntoService<Body, ()>>();
807
axum/src/serve/mod.rs
@@ -114,7 +114,7 @@ where
114
pub struct Serve<L, M, S> {
115
listener: L,
116
make_service: M,
117
- _marker: PhantomData<S>,
+ _marker: PhantomData<fn() -> S>,
118
119
120
#[cfg(all(feature = "tokio", any(feature = "http1", feature = "http2")))]
@@ -239,7 +239,7 @@ pub struct WithGracefulShutdown<L, M, S, F> {
239
240
241
signal: F,
242
243
244
245
0 commit comments