diff --git a/actix-service/src/and_then.rs b/actix-service/src/and_then.rs
index ee0f5e18..5dbc343e 100644
--- a/actix-service/src/and_then.rs
+++ b/actix-service/src/and_then.rs
@@ -107,19 +107,23 @@ where
}
/// `AndThenNewService` new service combinator
-pub struct AndThenNewService {
+pub struct AndThenNewService
+where
+ A: NewService,
+ B: NewService,
+{
a: A,
b: B,
_t: PhantomData,
}
-impl AndThenNewService {
+impl AndThenNewService
+where
+ A: NewService,
+ B: NewService,
+{
/// Create new `AndThen` combinator
- pub fn new>(a: A, f: F) -> Self
- where
- A: NewService,
- B: NewService,
- {
+ pub fn new>(a: A, f: F) -> Self {
Self {
a,
b: f.into_new_service(),
@@ -148,8 +152,8 @@ where
impl Clone for AndThenNewService
where
- A: Clone,
- B: Clone,
+ A: NewService + Clone,
+ B: NewService + Clone,
{
fn clone(&self) -> Self {
Self {