Skip to content

Commit

Permalink
feat: Relax GrpcMethod lifetime
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto committed May 21, 2024
1 parent f88eb79 commit 7142633
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
Expand Up @@ -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 }
}

Expand Down

0 comments on commit 7142633

Please sign in to comment.