mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Auto merge of #14502 - servo:filter-map, r=frewsxcv
Replace an unidiomatic use of filter_map(). <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14502) <!-- Reviewable:end -->
This commit is contained in:
commit
da2f41ba13
1 changed files with 3 additions and 5 deletions
|
@ -1201,11 +1201,9 @@ fn cors_preflight_fetch(request: Rc<Request>,
|
|||
|
||||
// Step 3, 4
|
||||
let mut value = request.headers.borrow().iter()
|
||||
.filter_map(|ref view| if is_simple_header(view) {
|
||||
None
|
||||
} else {
|
||||
Some(UniCase(view.name().to_owned()))
|
||||
}).collect::<Vec<UniCase<String>>>();
|
||||
.filter(|view| !is_simple_header(view))
|
||||
.map(|view| UniCase(view.name().to_owned()))
|
||||
.collect::<Vec<UniCase<String>>>();
|
||||
value.sort();
|
||||
|
||||
// Step 5
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue