Impl Layer for &Layer (#446)

This commit is contained in:
Steven Fackler 2020-04-21 17:11:27 -04:00 committed by GitHub
parent 39112cb0ba
commit 82e578b5b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -88,3 +88,14 @@ pub trait Layer<S> {
/// that has been decorated with the middleware.
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)
}
}