diff options
author | Heiko Schaefer <heiko@schaefer.name> | 2022-10-05 18:31:20 +0200 |
---|---|---|
committer | Heiko Schaefer <heiko@schaefer.name> | 2022-10-07 11:55:34 +0200 |
commit | c093b28e4dc48c5b60792dcc76d83dcf068015b1 (patch) | |
tree | 78ec45e9056edf6896b1e43cb7ad9d36059aa9fa /net | |
parent | ed090590b96617ee6bb0d58611b7da233c11521f (diff) |
net: use Option::and_then instead of .map and .flatten
More idiomatic this way.
Sponsored-by: pep.foundation
Diffstat (limited to 'net')
-rw-r--r-- | net/src/wkd.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/src/wkd.rs b/net/src/wkd.rs index 7a81831e..d2b6b4b9 100644 --- a/net/src/wkd.rs +++ b/net/src/wkd.rs @@ -211,8 +211,7 @@ where if let Ok(ref resp) = response { if resp.status().is_redirection() { let url = resp.headers().get("Location") - .map(|value| value.to_str().ok()) - .flatten() + .and_then(|value| value.to_str().ok()) .map(|value| value.parse::<Uri>()); if let Some(Ok(url)) = url { return get_following_redirects(client, url, depth - 1).await; |