mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 02:48:24 +00:00
refactor: clean up unwrap
and clone
(#17282)
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
This commit is contained in:
parent
05ef925eb0
commit
fd85f840cd
15 changed files with 75 additions and 94 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue