mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #9951 - Ms2ger:fetch-unwrap, r=ecoal95
Use a match rather than unwrap() in main_fetch. <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9951) <!-- Reviewable:end -->
This commit is contained in:
commit
20992c9df9
1 changed files with 35 additions and 35 deletions
|
@ -138,8 +138,9 @@ fn main_fetch(request: Rc<Request>, cors_flag: bool, recursive_flag: bool) -> Re
|
|||
// this step is obsoleted by fetch_async
|
||||
|
||||
// Step 9
|
||||
let response = if response.is_none() {
|
||||
|
||||
let response = match response {
|
||||
Some(response) => response,
|
||||
None => {
|
||||
let current_url = request.current_url();
|
||||
let same_origin = if let Origin::Origin(ref origin) = *request.origin.borrow() {
|
||||
*origin == current_url.origin()
|
||||
|
@ -181,8 +182,7 @@ fn main_fetch(request: Rc<Request>, cors_flag: bool, recursive_flag: bool) -> Re
|
|||
request.response_tainting.set(ResponseTainting::CORSTainting);
|
||||
http_fetch(request.clone(), BasicCORSCache::new(), true, false, false)
|
||||
}
|
||||
} else {
|
||||
response.unwrap()
|
||||
}
|
||||
};
|
||||
|
||||
// Step 10
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue