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 upstyle: Multiple cleanups around parsing code. #16283
Conversation
highfive
commented
Apr 6, 2017
|
Heads up! This PR modifies the following files:
|
highfive
commented
Apr 6, 2017
|
r? @wafflespeanut or @Manishearth or @canaltinova |
|
Nice cleanup! r=me after addressing the nits |
| } | ||
|
|
||
| try!(input.expect_function_matching("fit-content")); | ||
| // FIXME(emilio): This needs a parse_nested_block, doesn't it? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
emilio
Apr 6, 2017
Author
Member
Given that hasn't merged yet, and this needs a rebase anyway, I'd rather leave it there until that merges (btw, let me know when is it ready for re-review! I just saw a bunch of comments addressed that I wouldn't have noticed otherwise).
| let inflexible_breadth = | ||
| match input.try(LengthOrPercentage::parse_non_negative) { | ||
| Ok(lop) => TrackBreadth::Breadth(lop), | ||
| Err(..) => TrackBreadth::Keyword(try!(TrackKeyword::parse(input))), |
This comment has been minimized.
This comment has been minimized.
wafflespeanut
Apr 6, 2017
Member
Nit: Clearly TrackKeyword::parse(input).map(TrackBreadth::Keyword) is better, right?
This comment has been minimized.
This comment has been minimized.
emilio
Apr 6, 2017
Author
Member
I don't strictly think so, it creates an unnecessary TrackBreadth when parsing fails, but I could split it like:
let keyword = try!(TrackKeyword::parse(..));
TrackBreadth::Keyword(keyword)which is a bit nicer to read.
06a1376
to
d947d98
|
@bors-servo r=WafflesPeanut |
|
|
…anut style: Multiple cleanups around parsing code. <!-- 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/16283) <!-- Reviewable:end -->
|
|
|
Looks like the unit tests need to be updated (just an import). |
d947d98
to
846c950
|
@bors-servo r=Wafflespeanut |
|
|
…anut style: Multiple cleanups around parsing code. <!-- 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/16283) <!-- Reviewable:end -->
|
|
emilio commentedApr 6, 2017
•
edited by larsbergstrom
This change is