diff --git a/tonic/src/extensions.rs b/tonic/src/extensions.rs index 37d84b87b..f248e757d 100644 --- a/tonic/src/extensions.rs +++ b/tonic/src/extensions.rs @@ -75,15 +75,15 @@ impl fmt::Debug for Extensions { /// A gRPC Method info extension. #[derive(Debug, Clone)] -pub struct GrpcMethod { - service: &'static str, - method: &'static str, +pub struct GrpcMethod<'a> { + service: &'a str, + method: &'a str, } -impl GrpcMethod { +impl<'a> GrpcMethod<'a> { /// Create a new `GrpcMethod` extension. #[doc(hidden)] - pub fn new(service: &'static str, method: &'static str) -> Self { + pub fn new(service: &'a str, method: &'a str) -> Self { Self { service, method } }