Skip to content
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

style: Less messy namespace handling. #18142

Merged
merged 4 commits into from Aug 18, 2017
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

style: A few minor formatting cleanups.

  • Loading branch information
emilio committed Aug 18, 2017
commit 4763d05cf0e644cb1a1dcf3f98ffaee743965a0e
@@ -61,13 +61,14 @@ pub struct ParserContext<'a> {

impl<'a> ParserContext<'a> {
/// Create a parser context.
pub fn new(stylesheet_origin: Origin,
url_data: &'a UrlExtraData,
error_reporter: &'a ParseErrorReporter,
rule_type: Option<CssRuleType>,
parsing_mode: ParsingMode,
quirks_mode: QuirksMode)
-> ParserContext<'a> {
pub fn new(
stylesheet_origin: Origin,
url_data: &'a UrlExtraData,
error_reporter: &'a ParseErrorReporter,
rule_type: Option<CssRuleType>,
parsing_mode: ParsingMode,
quirks_mode: QuirksMode,
) -> ParserContext<'a> {
ParserContext {
stylesheet_origin: stylesheet_origin,
url_data: url_data,
@@ -88,7 +89,14 @@ impl<'a> ParserContext<'a> {
parsing_mode: ParsingMode,
quirks_mode: QuirksMode
) -> ParserContext<'a> {
Self::new(Origin::Author, url_data, error_reporter, rule_type, parsing_mode, quirks_mode)
Self::new(
Origin::Author,
url_data,
error_reporter,
rule_type,
parsing_mode,
quirks_mode,
)
}

/// Create a parser context based on a previous context, but with a modified rule type.
@@ -115,7 +123,7 @@ impl<'a> ParserContext<'a> {
error_reporter: &'a ParseErrorReporter,
line_number_offset: u64,
parsing_mode: ParsingMode,
quirks_mode: QuirksMode
quirks_mode: QuirksMode,
) -> ParserContext<'a> {
ParserContext {
stylesheet_origin: stylesheet_origin,
@@ -158,8 +158,10 @@ impl<'a, 'i> AtRuleParser<'i> for TopLevelRuleParser<'a> {
name: CowRcStr<'i>,
input: &mut Parser<'i, 't>
) -> Result<AtRuleType<AtRulePrelude, CssRule>, ParseError<'i>> {
let location = get_location_with_offset(input.current_source_location(),
self.context.line_number_offset);
let location = get_location_with_offset(
input.current_source_location(),
self.context.line_number_offset,
);
match_ignore_ascii_case! { &*name,
"import" => {
if self.state > State::Imports {
@@ -241,8 +243,11 @@ impl<'a, 'i> AtRuleParser<'i> for TopLevelRuleParser<'a> {
}

#[inline]
fn parse_block<'t>(&mut self, prelude: AtRulePrelude, input: &mut Parser<'i, 't>)
-> Result<CssRule, ParseError<'i>> {
fn parse_block<'t>(
&mut self,
prelude: AtRulePrelude,
input: &mut Parser<'i, 't>
) -> Result<CssRule, ParseError<'i>> {
AtRuleParser::parse_block(&mut self.nested(), prelude, input)
}
}
@@ -258,8 +263,10 @@ impl<'a, 'i> QualifiedRuleParser<'i> for TopLevelRuleParser<'a> {
type Error = SelectorParseError<'i, StyleParseError<'i>>;

#[inline]
fn parse_prelude<'t>(&mut self, input: &mut Parser<'i, 't>)
-> Result<QualifiedRuleParserPrelude, ParseError<'i>> {
fn parse_prelude<'t>(
&mut self,
input: &mut Parser<'i, 't>,
) -> Result<QualifiedRuleParserPrelude, ParseError<'i>> {
self.state = State::Body;
QualifiedRuleParser::parse_prelude(&mut self.nested(), input)
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.