-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP #817
WIP #817
Conversation
); | ||
|
||
let start = Instant::now(); | ||
let mut svc = self.inner.clone(); | ||
let service_name = self.service_name.clone(); | ||
let protocal = self.protocal.clone(); | ||
let protocal = self.protocol.clone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo here still protocol
} | ||
} | ||
|
||
impl<T, R> Clone for MetricsLayer<T, R> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed to manually implement clone because derive(Clone)
requires that T, R
be Clone
, where they don't need to be since we're using phantom data.
_request_type: PhantomData<R>, | ||
} | ||
|
||
impl<S, T, R> Clone for MetricsMiddleware<S, T, R> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same reason here
S: Service<R> + Send + Clone + 'static, | ||
S::Future: Send + 'static, | ||
T: RequestExtractor<R> + 'static, | ||
R: Send + 'static, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed all of the Sync
from these bounds as its not required by Service
. Tbh I'm unsure why but this made the compiler happy, example here https://github.com/hyperium/tonic/blob/master/examples/src/tower/server.rs
&method_name, | ||
&service_name, | ||
&protocal, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very common to convert String -> &str with a dereference
[Closes/Fixes] #
Proposed Changes