Skip to content

Commit

Permalink
Internally Arc Router
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpdrsn committed Dec 30, 2023
1 parent e12fab3 commit ba1bd91
Show file tree
Hide file tree
Showing 6 changed files with 155 additions and 111 deletions.
2 changes: 1 addition & 1 deletion axum/src/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ where
(self.into_route)(self.router, state)
}

fn call_with_state(mut self: Box<Self>, request: Request, state: S) -> RouteFuture<Infallible> {
fn call_with_state(self: Box<Self>, request: Request, state: S) -> RouteFuture<Infallible> {
self.router.call_with_state(request, state)
}
}
Expand Down
6 changes: 3 additions & 3 deletions axum/src/routing/method_routing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ where
self
}

pub(crate) fn call_with_state(&mut self, req: Request, state: S) -> RouteFuture<E> {
pub(crate) fn call_with_state(&self, req: Request, state: S) -> RouteFuture<E> {
macro_rules! call {
(
$req:expr,
Expand All @@ -1039,7 +1039,7 @@ where
.strip_body($method == Method::HEAD);
}
MethodEndpoint::BoxedHandler(handler) => {
let mut route = handler.clone().into_route(state);
let route = handler.clone().into_route(state);
return RouteFuture::from_future(route.oneshot_inner($req))
.strip_body($method == Method::HEAD);
}
Expand Down Expand Up @@ -1220,7 +1220,7 @@ where
{
type Future = InfallibleRouteFuture;

fn call(mut self, req: Request, state: S) -> Self::Future {
fn call(self, req: Request, state: S) -> Self::Future {
InfallibleRouteFuture::new(self.call_with_state(req, state))
}
}
Expand Down
Loading

0 comments on commit ba1bd91

Please sign in to comment.