Impl Layer for &Layer (#446)
This commit is contained in:
parent
39112cb0ba
commit
82e578b5b0
|
@ -88,3 +88,14 @@ pub trait Layer<S> {
|
||||||
/// that has been decorated with the middleware.
|
/// that has been decorated with the middleware.
|
||||||
fn layer(&self, inner: S) -> Self::Service;
|
fn layer(&self, inner: S) -> Self::Service;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a, T, S> Layer<S> for &'a T
|
||||||
|
where
|
||||||
|
T: ?Sized + Layer<S>,
|
||||||
|
{
|
||||||
|
type Service = T::Service;
|
||||||
|
|
||||||
|
fn layer(&self, inner: S) -> Self::Service {
|
||||||
|
(**self).layer(inner)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue