style: Use a more consistent style for parsing functions.

This commit is contained in:
Emilio Cobos Álvarez 2018-04-02 02:19:59 +02:00
parent 39018f9339
commit 15c416b133
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
14 changed files with 126 additions and 69 deletions

View file

@ -601,17 +601,20 @@ impl Length {
/// Parse a non-negative length
#[inline]
pub fn parse_non_negative<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
-> Result<Length, ParseError<'i>> {
pub fn parse_non_negative<'i, 't>(
context: &ParserContext,
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>> {
Self::parse_non_negative_quirky(context, input, AllowQuirks::No)
}
/// Parse a non-negative length, allowing quirks.
#[inline]
pub fn parse_non_negative_quirky<'i, 't>(context: &ParserContext,
input: &mut Parser<'i, 't>,
allow_quirks: AllowQuirks)
-> Result<Length, ParseError<'i>> {
pub fn parse_non_negative_quirky<'i, 't>(
context: &ParserContext,
input: &mut Parser<'i, 't>,
allow_quirks: AllowQuirks,
) -> Result<Self, ParseError<'i>> {
Self::parse_internal(context, input, AllowedNumericType::NonNegative, allow_quirks)
}
@ -630,10 +633,11 @@ impl Parse for Length {
impl Length {
/// Parses a length, with quirks.
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>> {
Self::parse_internal(context, input, AllowedNumericType::All, allow_quirks)
}
}