diff --git a/src/fetch/mod.rs b/src/fetch/mod.rs index 494d69e..67165a9 100644 --- a/src/fetch/mod.rs +++ b/src/fetch/mod.rs @@ -65,8 +65,7 @@ pub async fn fetch_object_http( let content_type = res .content_type .as_ref() - .map(|c| c.to_str().ok()) - .flatten() + .and_then(|c| c.to_str().ok()) .ok_or(Error::FetchInvalidContentType(res.url.clone()))?; if !VALID_RESPONSE_CONTENT_TYPES.contains(&content_type) { return Err(Error::FetchInvalidContentType(res.url));