diff options
author | Yiyu Lin <linyiyu1992@gmail.com> | 2023-01-15 12:06:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-15 09:36:46 +0530 |
commit | fd85f840cd707c31d08fa836562127e249c9ff62 (patch) | |
tree | c4847881976069d41d1b53616bdeaf5d073f3af6 /cli/http_util.rs | |
parent | 05ef925eb095ae603f694fe8172ddcbd5b19b9b2 (diff) |
refactor: clean up `unwrap` and `clone` (#17282)
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
Diffstat (limited to 'cli/http_util.rs')
-rw-r--r-- | cli/http_util.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cli/http_util.rs b/cli/http_util.rs index acec73436..52d0cb664 100644 --- a/cli/http_util.rs +++ b/cli/http_util.rs @@ -53,7 +53,7 @@ pub fn resolve_redirect_from_response( ) -> Result<Url, AnyError> { debug_assert!(response.status().is_redirection()); if let Some(location) = response.headers().get(LOCATION) { - let location_string = location.to_str().unwrap(); + let location_string = location.to_str()?; log::debug!("Redirecting to {:?}...", &location_string); let new_url = resolve_url_from_location(request_url, location_string); Ok(new_url) |