From 6840d393d21564839d88ce94e67791896db6b0da Mon Sep 17 00:00:00 2001 From: Sacha Morard <2254275+SachaMorard@users.noreply.github.com> Date: Wed, 23 Oct 2024 05:47:24 +0200 Subject: [PATCH] chore: fmt --- src/proxy/compute/compute.rs | 5 +---- src/proxy/controller/controller.rs | 3 +-- src/proxy/proxy.rs | 5 +---- src/tools/edgee_cookie.rs | 6 +----- 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/proxy/compute/compute.rs b/src/proxy/compute/compute.rs index ddd01fd..aa407bf 100644 --- a/src/proxy/compute/compute.rs +++ b/src/proxy/compute/compute.rs @@ -101,10 +101,7 @@ pub async fn json_handler( /// * The `disableEdgeDataCollection` query parameter is present in the URL of the request. /// * The response is cacheable. /// * The request is for prefetch (indicated by the `Purpose` or `Sec-Purpose` headers). -fn do_process_payload( - request: &RequestHandle, - response: &mut Parts, -) -> Result { +fn do_process_payload(request: &RequestHandle, response: &mut Parts) -> Result { // do not process the payload if disableEdgeDataCollection query param is present in the URL let query = request.get_query().as_str(); if query.contains("disableEdgeDataCollection") { diff --git a/src/proxy/controller/controller.rs b/src/proxy/controller/controller.rs index 391dee9..771e066 100644 --- a/src/proxy/controller/controller.rs +++ b/src/proxy/controller/controller.rs @@ -29,8 +29,7 @@ pub async fn edgee_client_event(ctx: IncomingContext) -> anyhow::Result 0 { - let data_collection_events_res = - compute::json_handler(&body, request, &mut response).await; + let data_collection_events_res = compute::json_handler(&body, request, &mut response).await; if data_collection_events_res.is_some() { data_collection_events = data_collection_events_res.unwrap(); } diff --git a/src/proxy/proxy.rs b/src/proxy/proxy.rs index c8eb0a5..986338d 100644 --- a/src/proxy/proxy.rs +++ b/src/proxy/proxy.rs @@ -274,10 +274,7 @@ pub async fn handle_request( Some(compute_duration), ); - Ok(controller::build_response( - response, - Bytes::from(data), - )) + Ok(controller::build_response(response, Bytes::from(data))) } } } diff --git a/src/tools/edgee_cookie.rs b/src/tools/edgee_cookie.rs index aad7adc..63c819c 100644 --- a/src/tools/edgee_cookie.rs +++ b/src/tools/edgee_cookie.rs @@ -57,11 +57,7 @@ impl EdgeeCookie { /// # Returns /// /// * `EdgeeCookie` - The `EdgeeCookie` that was retrieved or newly created. -pub fn get_or_set( - request: &RequestHandle, - response: &mut Parts, - payload: &Payload, -) -> EdgeeCookie { +pub fn get_or_set(request: &RequestHandle, response: &mut Parts, payload: &Payload) -> EdgeeCookie { let edgee_cookie = get(request, response, payload); if edgee_cookie.is_none() { return init_and_set_cookie(request, response, payload);