From 441e8776c1d0a78be4d3ddb65ec8472faf2f1fb6 Mon Sep 17 00:00:00 2001 From: tottoto Date: Fri, 12 Jan 2024 13:21:45 +0900 Subject: [PATCH] feat: Relax GrpcMethod lifetime --- 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 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 } }