From 68bf17d67ad71af44c34d565566c3dd58ea3ab87 Mon Sep 17 00:00:00 2001 From: tottoto Date: Thu, 13 Jun 2024 17:23:04 +0900 Subject: [PATCH] feat: Relax GrpcMethod lifetime (#1598) --- tonic/src/extensions.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tonic/src/extensions.rs b/tonic/src/extensions.rs index bfeee0fc9..6583d29e2 100644 --- a/tonic/src/extensions.rs +++ b/tonic/src/extensions.rs @@ -1,14 +1,14 @@ /// 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 } }