mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-22 00:00:17 +02:00
Add Send + Sync check to all services (#277)
Should prevent us accidentally introducing breaking changes. Fixes https://github.com/tokio-rs/axum/issues/275
This commit is contained in:
@@ -29,6 +29,13 @@ pub struct IntoMakeServiceWithConnectInfo<S, C> {
|
||||
_connect_info: PhantomData<fn() -> C>,
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn traits() {
|
||||
use crate::tests::*;
|
||||
assert_send::<IntoMakeServiceWithConnectInfo<(), NotSendSync>>();
|
||||
assert_sync::<IntoMakeServiceWithConnectInfo<(), NotSendSync>>();
|
||||
}
|
||||
|
||||
impl<S, C> IntoMakeServiceWithConnectInfo<S, C> {
|
||||
pub(crate) fn new(svc: S) -> Self {
|
||||
Self {
|
||||
|
||||
@@ -132,6 +132,13 @@ pub struct ExtractorMiddleware<S, E> {
|
||||
_extractor: PhantomData<fn() -> E>,
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn traits() {
|
||||
use crate::tests::*;
|
||||
assert_send::<ExtractorMiddleware<(), NotSendSync>>();
|
||||
assert_sync::<ExtractorMiddleware<(), NotSendSync>>();
|
||||
}
|
||||
|
||||
impl<S, E> Clone for ExtractorMiddleware<S, E>
|
||||
where
|
||||
S: Clone,
|
||||
|
||||
Reference in New Issue
Block a user