@@ -186,8 +186,7 @@ pub trait QualifiedRuleParser {
186
186
187
187
188
188
/// Provides an iterator for declaration list parsing.
189
- pub struct DeclarationListParser < ' i : ' t , ' t : ' a , ' a , I , P >
190
- where P : DeclarationParser < Declaration = I > + AtRuleParser < AtRule = I > {
189
+ pub struct DeclarationListParser < ' i : ' t , ' t : ' a , ' a , P > {
191
190
/// The input given to `DeclarationListParser::new`
192
191
pub input : & ' a mut Parser < ' i , ' t > ,
193
192
@@ -196,7 +195,7 @@ where P: DeclarationParser<Declaration = I> + AtRuleParser<AtRule = I> {
196
195
}
197
196
198
197
199
- impl < ' i , ' t , ' a , I , P > DeclarationListParser < ' i , ' t , ' a , I , P >
198
+ impl < ' i , ' t , ' a , I , P > DeclarationListParser < ' i , ' t , ' a , P >
200
199
where P : DeclarationParser < Declaration = I > + AtRuleParser < AtRule = I > {
201
200
/// Create a new `DeclarationListParser` for the given `input` and `parser`.
202
201
///
@@ -212,8 +211,7 @@ where P: DeclarationParser<Declaration = I> + AtRuleParser<AtRule = I> {
212
211
/// The return type for finished declarations and at-rules also needs to be the same,
213
212
/// since `<DeclarationListParser as Iterator>::next` can return either.
214
213
/// It could be a custom enum.
215
- pub fn new ( input : & ' a mut Parser < ' i , ' t > , parser : P )
216
- -> DeclarationListParser < ' i , ' t , ' a , I , P > {
214
+ pub fn new ( input : & ' a mut Parser < ' i , ' t > , parser : P ) -> Self {
217
215
DeclarationListParser {
218
216
input : input,
219
217
parser : parser,
@@ -223,7 +221,7 @@ where P: DeclarationParser<Declaration = I> + AtRuleParser<AtRule = I> {
223
221
224
222
/// `DeclarationListParser` is an iterator that yields `Ok(_)` for a valid declaration or at-rule
225
223
/// or `Err(())` for an invalid one.
226
- impl < ' i , ' t , ' a , I , P > Iterator for DeclarationListParser < ' i , ' t , ' a , I , P >
224
+ impl < ' i , ' t , ' a , I , P > Iterator for DeclarationListParser < ' i , ' t , ' a , P >
227
225
where P : DeclarationParser < Declaration = I > + AtRuleParser < AtRule = I > {
228
226
type Item = Result < I , Range < SourcePosition > > ;
229
227
@@ -256,8 +254,7 @@ where P: DeclarationParser<Declaration = I> + AtRuleParser<AtRule = I> {
256
254
257
255
258
256
/// Provides an iterator for rule list parsing.
259
- pub struct RuleListParser < ' i : ' t , ' t : ' a , ' a , R , P >
260
- where P : QualifiedRuleParser < QualifiedRule = R > + AtRuleParser < AtRule = R > {
257
+ pub struct RuleListParser < ' i : ' t , ' t : ' a , ' a , P > {
261
258
/// The input given to `RuleListParser::new`
262
259
pub input : & ' a mut Parser < ' i , ' t > ,
263
260
@@ -269,7 +266,7 @@ where P: QualifiedRuleParser<QualifiedRule = R> + AtRuleParser<AtRule = R> {
269
266
}
270
267
271
268
272
- impl < ' i : ' t , ' t : ' a , ' a , R , P > RuleListParser < ' i , ' t , ' a , R , P >
269
+ impl < ' i : ' t , ' t : ' a , ' a , R , P > RuleListParser < ' i , ' t , ' a , P >
273
270
where P : QualifiedRuleParser < QualifiedRule = R > + AtRuleParser < AtRule = R > {
274
271
/// Create a new `RuleListParser` for the given `input` at the top-level of a stylesheet
275
272
/// and the given `parser`.
@@ -281,8 +278,7 @@ where P: QualifiedRuleParser<QualifiedRule = R> + AtRuleParser<AtRule = R> {
281
278
/// The return type for finished qualified rules and at-rules also needs to be the same,
282
279
/// since `<RuleListParser as Iterator>::next` can return either.
283
280
/// It could be a custom enum.
284
- pub fn new_for_stylesheet ( input : & ' a mut Parser < ' i , ' t > , parser : P )
285
- -> RuleListParser < ' i , ' t , ' a , R , P > {
281
+ pub fn new_for_stylesheet ( input : & ' a mut Parser < ' i , ' t > , parser : P ) -> Self {
286
282
RuleListParser {
287
283
input : input,
288
284
parser : parser,
@@ -297,8 +293,7 @@ where P: QualifiedRuleParser<QualifiedRule = R> + AtRuleParser<AtRule = R> {
297
293
/// This differs in that `<!--` and `-->` tokens
298
294
/// should only be ignored at the stylesheet top-level.
299
295
/// (This is to deal with legacy work arounds for `<style>` HTML element parsing.)
300
- pub fn new_for_nested_rule ( input : & ' a mut Parser < ' i , ' t > , parser : P )
301
- -> RuleListParser < ' i , ' t , ' a , R , P > {
296
+ pub fn new_for_nested_rule ( input : & ' a mut Parser < ' i , ' t > , parser : P ) -> Self {
302
297
RuleListParser {
303
298
input : input,
304
299
parser : parser,
@@ -311,7 +306,7 @@ where P: QualifiedRuleParser<QualifiedRule = R> + AtRuleParser<AtRule = R> {
311
306
312
307
313
308
/// `RuleListParser` is an iterator that yields `Ok(_)` for a rule or `Err(())` for an invalid one.
314
- impl < ' i , ' t , ' a , R , P > Iterator for RuleListParser < ' i , ' t , ' a , R , P >
309
+ impl < ' i , ' t , ' a , R , P > Iterator for RuleListParser < ' i , ' t , ' a , P >
315
310
where P : QualifiedRuleParser < QualifiedRule = R > + AtRuleParser < AtRule = R > {
316
311
type Item = Result < R , Range < SourcePosition > > ;
317
312
0 commit comments