@@ -24,15 +24,15 @@ use ast::*;
24
24
/// Return a Iterator<Result<Rule, SyntaxError>>
25
25
#[ inline]
26
26
pub fn parse_stylesheet_rules < T : Iterator < Node > > ( iter : T ) -> StylesheetParser < T > {
27
- StylesheetParser ( iter)
27
+ StylesheetParser { iter : iter }
28
28
}
29
29
30
30
31
31
/// Parse a non-top level list of rules eg. the content of an @media rule.
32
32
/// Return a Iterator<Result<Rule, SyntaxError>>
33
33
#[ inline]
34
34
pub fn parse_rule_list < T : Iterator < Node > > ( iter : T ) -> RuleListParser < T > {
35
- RuleListParser ( iter)
35
+ RuleListParser { iter : iter }
36
36
}
37
37
38
38
@@ -41,19 +41,19 @@ pub fn parse_rule_list<T: Iterator<Node>>(iter: T) -> RuleListParser<T> {
41
41
/// Return a Iterator<Result<DeclarationListItem, SyntaxError>>
42
42
#[ inline]
43
43
pub fn parse_declaration_list < T : Iterator < Node > > ( iter : T ) -> DeclarationListParser < T > {
44
- DeclarationListParser ( iter)
44
+ DeclarationListParser { iter : iter }
45
45
}
46
46
47
47
48
48
/// Parse a single rule.
49
49
/// Used eg. for CSSRuleList.insertRule()
50
50
pub fn parse_one_rule < T : Iterator < Node > > ( iter : T ) -> Result < Rule , SyntaxError > {
51
- let mut parser = RuleListParser ( iter) ;
51
+ let mut parser = RuleListParser { iter : iter } ;
52
52
match parser. next ( ) {
53
53
None => error ( START_LOCATION , ErrEmptyInput ) ,
54
54
Some ( result) => {
55
55
if result. is_err ( ) { result }
56
- else { match next_non_whitespace ( & mut * parser) {
56
+ else { match next_non_whitespace ( & mut parser. iter ) {
57
57
None => result,
58
58
Some ( ( _component_value, location) ) => error ( location, ErrExtraInput ) ,
59
59
} }
@@ -98,9 +98,9 @@ pub fn parse_one_component_value<T: Iterator<Node>>(mut iter: T)
98
98
// *********** End of public API ***********
99
99
100
100
101
- struct StylesheetParser < T > ( T ) ;
102
- struct RuleListParser < T > ( T ) ;
103
- struct DeclarationListParser < T > ( T ) ;
101
+ struct StylesheetParser < T > { iter : T }
102
+ struct RuleListParser < T > { iter : T }
103
+ struct DeclarationListParser < T > { iter : T }
104
104
105
105
106
106
// Work around "error: cannot borrow `*iter` as mutable more than once at a time"
@@ -116,7 +116,7 @@ macro_rules! for_iter(
116
116
117
117
impl < T : Iterator < Node > > Iterator < Result < Rule , SyntaxError > > for StylesheetParser < T > {
118
118
fn next ( & mut self ) -> Option < Result < Rule , SyntaxError > > {
119
- let iter = & mut * * self ;
119
+ let iter = & mut self . iter ;
120
120
for_iter ! ( iter, ( component_value, location) , {
121
121
match component_value {
122
122
WhiteSpace | CDO | CDC => ( ) ,
@@ -134,7 +134,7 @@ impl<T: Iterator<Node>> Iterator<Result<Rule, SyntaxError>> for StylesheetParser
134
134
135
135
impl < T : Iterator < Node > > Iterator < Result < Rule , SyntaxError > > for RuleListParser < T > {
136
136
fn next ( & mut self ) -> Option < Result < Rule , SyntaxError > > {
137
- let iter = & mut * * self ;
137
+ let iter = & mut self . iter ;
138
138
for_iter ! ( iter, ( component_value, location) , {
139
139
match component_value {
140
140
WhiteSpace => ( ) ,
@@ -153,7 +153,7 @@ impl<T: Iterator<Node>> Iterator<Result<Rule, SyntaxError>> for RuleListParser<T
153
153
impl < T : Iterator < Node > > Iterator < Result < DeclarationListItem , SyntaxError > >
154
154
for DeclarationListParser < T > {
155
155
fn next ( & mut self ) -> Option < Result < DeclarationListItem , SyntaxError > > {
156
- let iter = & mut * * self ;
156
+ let iter = & mut self . iter ;
157
157
for_iter ! ( iter, ( component_value, location) , {
158
158
match component_value {
159
159
WhiteSpace | Semicolon => ( ) ,
0 commit comments