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:
bors-servo 2016-12-08 15:12:42 -08:00 committed by GitHub
commit da2f41ba13

View file

@ -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