From 623bcde11132ccd9bcd9b46a1f21a4a55aafe2b0 Mon Sep 17 00:00:00 2001 From: chickenleaf Date: Wed, 9 Oct 2024 11:41:15 +0530 Subject: [PATCH] Fix Clippy warning: Replace map().flatten() with and_then() in http_loader.rs (#33744) Signed-off-by: L Ashwin B --- components/net/http_loader.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/net/http_loader.rs b/components/net/http_loader.rs index b282ee270ef..6c7251d12d2 100644 --- a/components/net/http_loader.rs +++ b/components/net/http_loader.rs @@ -1142,8 +1142,7 @@ async fn http_network_or_cache_fetch( let content_length = http_request .body .as_ref() - .map(|body| body.len().map(|size| size as u64)) - .flatten(); + .and_then(|body| body.len().map(|size| size as u64)); // Step 8.6 Let contentLengthHeaderValue be null. let mut content_length_header_value = None;