style: Formatting nits in color parsing.

This commit is contained in:
Emilio Cobos Álvarez 2017-12-01 21:45:57 +01:00
parent ea5efd9e2f
commit e91c9ec7fe
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -125,16 +125,17 @@ impl Color {
/// Parse a color, with quirks.
///
/// <https://quirks.spec.whatwg.org/#the-hashless-hex-color-quirk>
pub fn parse_quirky<'i, 't>(context: &ParserContext,
input: &mut Parser<'i, 't>,
allow_quirks: AllowQuirks)
-> Result<Self, ParseError<'i>> {
pub fn parse_quirky<'i, 't>(
context: &ParserContext,
input: &mut Parser<'i, 't>,
allow_quirks: AllowQuirks,
) -> Result<Self, ParseError<'i>> {
input.try(|i| Self::parse(context, i)).or_else(|e| {
if !allow_quirks.allowed(context.quirks_mode) {
return Err(e);
}
Color::parse_quirky_color(input)
.map(|rgba| Color::rgba(rgba))
.map(Color::rgba)
.map_err(|_| e)
})
}