Skip to content

Commit

Permalink
feat(build): add constructor from_arc for gRPC servers (#875)
Browse files Browse the repository at this point in the history
  • Loading branch information
athre0z authored Jan 12, 2022
1 parent 65eceb1 commit 7179f7a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tonic-build/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ pub fn generate<T: Service>(

impl<T: #server_trait> #server_service<T> {
pub fn new(inner: T) -> Self {
let inner = Arc::new(inner);
Self::from_arc(Arc::new(inner))
}

pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
Self {
inner,
Expand Down

0 comments on commit 7179f7a

Please sign in to comment.