Skip to content

Commit

Permalink
Add Clone to Extensions::insert<T>
Browse files Browse the repository at this point in the history
`http::Extensions::insert` requires `T: Clone` so we add it.
  • Loading branch information
allan2 committed Dec 7, 2023
1 parent 998f4f2 commit 3542956
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tonic/src/extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl Extensions {
/// If a extension of this type already existed, it will
/// be returned.
#[inline]
pub fn insert<T: Send + Sync + 'static>(&mut self, val: T) -> Option<T> {
pub fn insert<T: Send + Sync + Clone + 'static>(&mut self, val: T) -> Option<T> {
self.inner.insert(val)
}

Expand Down Expand Up @@ -95,3 +95,4 @@ impl GrpcMethod {
self.method
}
}

0 comments on commit 3542956

Please sign in to comment.