Skip to content

Commit 460eb9d

Browse files
committed
rules_and_declarations: Minor clean-ups.
1 parent 9ea6150 commit 460eb9d

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

src/rules_and_declarations.rs

+12-15
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,14 @@ pub trait AtRuleParser<'i> {
140140

141141
/// A trait to provide various parsing of qualified rules.
142142
///
143-
/// For example, there could be different implementations
144-
/// for top-level qualified rules (i.e. style rules with Selectors as prelude)
145-
/// and for qualified rules inside `@keyframes` (keyframe rules with keyframe selectors as prelude).
143+
/// For example, there could be different implementations for top-level qualified rules (i.e. style
144+
/// rules with Selectors as prelude) and for qualified rules inside `@keyframes` (keyframe rules
145+
/// with keyframe selectors as prelude).
146146
///
147-
/// Default implementations that reject all qualified rules are provided,
148-
/// so that `impl QualifiedRuleParser<(), ()> for ... {}` can be used
149-
/// for example for using `RuleListParser` to parse a rule list with only at-rules
150-
/// (such as inside `@font-feature-values`).
147+
/// Default implementations that reject all qualified rules are provided, so that
148+
/// `impl QualifiedRuleParser<(), ()> for ... {}` can be used for example for using
149+
/// `RuleListParser` to parse a rule list with only at-rules (such as inside
150+
/// `@font-feature-values`).
151151
pub trait QualifiedRuleParser<'i> {
152152
/// The intermediate representation of a qualified rule prelude.
153153
type Prelude;
@@ -223,10 +223,7 @@ where
223223
/// since `<DeclarationListParser as Iterator>::next` can return either.
224224
/// It could be a custom enum.
225225
pub fn new(input: &'a mut Parser<'i, 't>, parser: P) -> Self {
226-
DeclarationListParser {
227-
input: input,
228-
parser: parser,
229-
}
226+
DeclarationListParser { input, parser }
230227
}
231228
}
232229

@@ -304,8 +301,8 @@ where
304301
/// It could be a custom enum.
305302
pub fn new_for_stylesheet(input: &'a mut Parser<'i, 't>, parser: P) -> Self {
306303
RuleListParser {
307-
input: input,
308-
parser: parser,
304+
input,
305+
parser,
309306
is_stylesheet: true,
310307
any_rule_so_far: false,
311308
}
@@ -319,8 +316,8 @@ where
319316
/// (This is to deal with legacy workarounds for `<style>` HTML element parsing.)
320317
pub fn new_for_nested_rule(input: &'a mut Parser<'i, 't>, parser: P) -> Self {
321318
RuleListParser {
322-
input: input,
323-
parser: parser,
319+
input,
320+
parser,
324321
is_stylesheet: false,
325322
any_rule_so_far: false,
326323
}

0 commit comments

Comments
 (0)