Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upUse .find().map() instead of .filter_map().next() #9436
Conversation
…:Get
highfive
commented
Jan 26, 2016
| None | ||
| } | ||
| }).next() | ||
| list.iter().find(|&&(ref k, _)| k == &name.0).map(|&(_, ref v)| USVString(v.clone())) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
KiChjang
Jan 26, 2016
Member
Actually, is it possible to not have |&(ref k, _)| at all and simply have |ref kv| kv.0 == name.0 instead?
This comment has been minimized.
This comment has been minimized.
|
In its current state, I find the previous code much more readable than with these changes |
|
...though I think that can be improved if it was broken up into one line per each method call |
|
Agreed, let's break it down into two lines. |
|
I tried to implement all the suggestions. It's also possible to not work with
|
This comment has been minimized.
This comment has been minimized.
KiChjang
commented on components/script/dom/urlsearchparams.rs in e65d725
Jan 27, 2016
|
|
|
r=me post-nit, it's definitely fine to just use @bors-servo delegate+ |
|
|
So I leave it as it is. |
|
@bors-servo r+ Thanks! |
|
|
|
|
Use .find().map() instead of .filter_map().next() Patch for issue #9403 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9436) <!-- Reviewable:end -->
|
|
|
@bors-servo: retry
|
|
|
|
|
|
@bors-servo retry #9205 |
|
|
|
|
fstr commentedJan 26, 2016
Patch for issue #9403