Skip to content

Parser changes for Gecko integration #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 5, 2017
Prev Previous commit
Next Next commit
Style cleanup for existing parser code.
  • Loading branch information
jdm committed Jul 5, 2017
commit b0c8cdf2a90a27c48ae63706bb40e6c5890be37a
5 changes: 2 additions & 3 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,7 @@ impl<'i: 't, 't> Parser<'i, 't> {
match self.next()? {
Token::UnquotedUrl(value) => Ok(value),
Token::Function(ref name) if name.eq_ignore_ascii_case("url") => {
self.parse_nested_block(|input| input.expect_string()
.map_err(|e| ParseError::Basic(e)))
self.parse_nested_block(|input| input.expect_string().map_err(ParseError::Basic))
.map_err(ParseError::<()>::basic)
},
t => Err(BasicParseError::UnexpectedToken(t))
Expand All @@ -504,7 +503,7 @@ impl<'i: 't, 't> Parser<'i, 't> {
Token::UnquotedUrl(value) => Ok(value),
Token::QuotedString(value) => Ok(value),
Token::Function(ref name) if name.eq_ignore_ascii_case("url") => {
self.parse_nested_block(|input| input.expect_string().map_err(|e| ParseError::Basic(e)))
self.parse_nested_block(|input| input.expect_string().map_err(ParseError::Basic))
.map_err(ParseError::<()>::basic)
},
t => Err(BasicParseError::UnexpectedToken(t))
Expand Down