Fix Clippy warning: Replace map().flatten() with and_then() in http_loader.rs (#33744)

Signed-off-by: L Ashwin B <lashwinib@gmail.com>
This commit is contained in:
chickenleaf 2024-10-09 11:41:15 +05:30 committed by GitHub
parent 7df18aecfe
commit 623bcde111
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;