Skip to content

Commit

Permalink
fix: remove async closures
Browse files Browse the repository at this point in the history
  • Loading branch information
mrchantey committed Oct 3, 2024
1 parent 1e75155 commit e06e8a1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions crates/forky_cli/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// #![feature(never_type, never_type_fallback)]
#![feature(async_closure, let_chains)]
#![feature(let_chains)]
pub mod auto_mod;
pub mod common;
pub mod key;
pub mod server;
pub mod style;
pub mod key;
pub mod watch;

pub mod prelude {
Expand Down
11 changes: 7 additions & 4 deletions crates/forky_cli/src/server/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ impl Proxy {
}

pub async fn handle(&self, req: Request<Body>) -> Response<Body> {
(async || -> Result<Response<Body>> {
// (async || -> Result<Response<Body>> {

let result: Result<Response<Body>> = async {
let uri = req.uri();
let uri = uri.remove_leading_slash()?;
let proxied_referrer = referrer_is_proxied(&req);
Expand All @@ -111,9 +113,10 @@ impl Proxy {
// self.apply_next_origin(&uri)?;
handle_proxy_request_from_url(req, &uri).await
}
})()
.await
.to_response()
}
.await;
// })()
result.to_response()
}

fn apply_last_origin(&self, path: &str) -> Result<Uri> {
Expand Down

0 comments on commit e06e8a1

Please sign in to comment.