mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Replace an unidiomatic use of filter_map().
This commit is contained in:
parent
c9370e04a5
commit
fb456402b0
1 changed files with 3 additions and 5 deletions
|
@ -1248,11 +1248,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