From 4ca6325bad1d93b4e5c552d4b75663852a2a8868 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Tue, 19 May 2015 17:38:56 +0200 Subject: [PATCH] Remove an unwrap() call in HTTP fetch. --- components/net/fetch/request.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/net/fetch/request.rs b/components/net/fetch/request.rs index 7c44e5f14d5..42a9b737a21 100644 --- a/components/net/fetch/request.rs +++ b/components/net/fetch/request.rs @@ -263,12 +263,12 @@ impl Request { if !response.headers.has::() { return response; } - let location = response.headers.get::(); - if location.is_none() { - return Response::network_error(); - } + let location = match response.headers.get::() { + None => return Response::network_error(), + Some(location) => location, + }; // Step 5 - let locationUrl = Url::parse(location.unwrap()); + let locationUrl = Url::parse(location); // Step 6 let locationUrl = match locationUrl { Ok(url) => url,