Skip to content

Commit

Permalink
Implement Clone for RouterIntoService
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanburgers committed Dec 28, 2023
1 parent 3fda093 commit 58b09a4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions axum/src/routing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,18 @@ pub struct RouterIntoService<B, S = ()> {
_marker: PhantomData<B>,
}

impl<B, S> Clone for RouterIntoService<B, S>
where
Router<S>: Clone,
{
fn clone(&self) -> Self {
Self {
router: self.router.clone(),
_marker: PhantomData,
}
}
}

impl<B> Service<Request<B>> for RouterIntoService<B, ()>
where
B: HttpBody<Data = bytes::Bytes> + Send + 'static,
Expand Down

0 comments on commit 58b09a4

Please sign in to comment.