Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Relax GrpcMethod lifetime #1598

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions tonic/src/extensions.rs
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