Skip to content

Commit

Permalink
feat: Relax GrpcMethod lifetime (#1598)
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto committed Jun 13, 2024
1 parent 22ddcd3 commit 68bf17d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tonic/src/extensions.rs
Original file line number Diff line number Diff line change
@@ -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 }
}

Expand Down

0 comments on commit 68bf17d

Please sign in to comment.