Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Remove unnecessary with_state
Browse files Browse the repository at this point in the history
  • Loading branch information
cpubot committed Oct 11, 2023
1 parent e110bed commit 662691a
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@ pub(crate) async fn http_main(p_state: ProverState, port: u16) -> Result<()> {
debug!("listening on {}", addr);

let p_state = Arc::new(p_state);
let app = Router::new()
.route(
"/prove",
post({
let p_state = p_state.clone();
move |body| prove(body, p_state)
}),
)
.with_state(Arc::new(p_state));
let app = Router::new().route(
"/prove",
post({
let p_state = p_state.clone();
move |body| prove(body, p_state)
}),
);

Ok(axum::Server::bind(&addr)
.serve(app.into_make_service())
Expand Down

0 comments on commit 662691a

Please sign in to comment.