23
23
return Ok ( ast:: Expression :: Inline (
24
24
exp,
25
25
#[ cfg( feature = "spans" ) ]
26
- ast:: Span :: new ( start_span..self . ptr ) ,
26
+ ast:: Span ( start_span..self . ptr ) ,
27
27
) ) ;
28
28
}
29
29
68
68
selector : exp,
69
69
variants,
70
70
#[ cfg( feature = "spans" ) ]
71
- span : ast:: Span :: new ( start_span..self . ptr ) ,
71
+ span : ast:: Span ( start_span..self . ptr ) ,
72
72
} )
73
73
}
74
74
@@ -112,15 +112,15 @@ where
112
112
Ok ( ast:: InlineExpression :: StringLiteral {
113
113
value : slice,
114
114
#[ cfg( feature = "spans" ) ]
115
- span : ast:: Span :: new ( start..self . ptr ) ,
115
+ span : ast:: Span ( start..self . ptr ) ,
116
116
} )
117
117
}
118
118
Some ( b) if b. is_ascii_digit ( ) => {
119
119
let num = self . get_number_literal ( ) ?;
120
120
Ok ( ast:: InlineExpression :: NumberLiteral {
121
121
value : num,
122
122
#[ cfg( feature = "spans" ) ]
123
- span : ast:: Span :: new ( start..self . ptr ) ,
123
+ span : ast:: Span ( start..self . ptr ) ,
124
124
} )
125
125
}
126
126
Some ( b'-' ) if !only_literal => {
@@ -135,15 +135,15 @@ where
135
135
attribute,
136
136
arguments,
137
137
#[ cfg( feature = "spans" ) ]
138
- span : ast:: Span :: new ( start..self . ptr ) ,
138
+ span : ast:: Span ( start..self . ptr ) ,
139
139
} )
140
140
} else {
141
141
self . ptr -= 1 ;
142
142
let num = self . get_number_literal ( ) ?;
143
143
Ok ( ast:: InlineExpression :: NumberLiteral {
144
144
value : num,
145
145
#[ cfg( feature = "spans" ) ]
146
- span : ast:: Span :: new ( start..self . ptr ) ,
146
+ span : ast:: Span ( start..self . ptr ) ,
147
147
} )
148
148
}
149
149
}
@@ -153,7 +153,7 @@ where
153
153
Ok ( ast:: InlineExpression :: VariableReference {
154
154
id,
155
155
#[ cfg( feature = "spans" ) ]
156
- span : ast:: Span :: new ( start..self . ptr ) ,
156
+ span : ast:: Span ( start..self . ptr ) ,
157
157
} )
158
158
}
159
159
Some ( b) if b. is_ascii_alphabetic ( ) => {
@@ -169,15 +169,15 @@ where
169
169
id,
170
170
arguments,
171
171
#[ cfg( feature = "spans" ) ]
172
- span : ast:: Span :: new ( start..self . ptr ) ,
172
+ span : ast:: Span ( start..self . ptr ) ,
173
173
} )
174
174
} else {
175
175
let attribute = self . get_attribute_accessor ( ) ?;
176
176
Ok ( ast:: InlineExpression :: MessageReference {
177
177
id,
178
178
attribute,
179
179
#[ cfg( feature = "spans" ) ]
180
- span : ast:: Span :: new ( start..self . ptr ) ,
180
+ span : ast:: Span ( start..self . ptr ) ,
181
181
} )
182
182
}
183
183
}
@@ -187,7 +187,7 @@ where
187
187
Ok ( ast:: InlineExpression :: Placeable {
188
188
expression : Box :: new ( exp) ,
189
189
#[ cfg( feature = "spans" ) ]
190
- span : ast:: Span :: new ( start..self . ptr ) ,
190
+ span : ast:: Span ( start..self . ptr ) ,
191
191
} )
192
192
}
193
193
_ if only_literal => error ! ( ErrorKind :: ExpectedLiteral , self . ptr) ,
@@ -239,11 +239,11 @@ where
239
239
name : ast:: Identifier {
240
240
name : id. name . clone ( ) ,
241
241
#[ cfg( feature = "spans" ) ]
242
- span : id. span ,
242
+ span : id. span . clone ( ) ,
243
243
} ,
244
244
value : val,
245
245
#[ cfg( feature = "spans" ) ]
246
- span : ast:: Span :: new ( id. span . start ..self . ptr ) ,
246
+ span : ast:: Span ( id. span . start ..self . ptr ) ,
247
247
} ) ;
248
248
} else {
249
249
if !argument_names. is_empty ( ) {
@@ -269,7 +269,7 @@ where
269
269
positional,
270
270
named,
271
271
#[ cfg( feature = "spans" ) ]
272
- span : ast:: Span :: new ( start..self . ptr ) ,
272
+ span : ast:: Span ( start..self . ptr ) ,
273
273
} ) )
274
274
}
275
275
}
0 commit comments