aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_mbe/src/mbe_expander.rs
diff options
context:
space:
mode:
authorAlan Du <[email protected]>2019-06-03 15:21:08 +0100
committerAlan Du <[email protected]>2019-06-04 23:05:07 +0100
commit40424d4222d4630bc53294d10f1718f2d3d300de (patch)
tree4e27c7f2ce4a886e9a512b4986509b0927ae9ea1 /crates/ra_mbe/src/mbe_expander.rs
parented3d93b875f25da6f81b8a107a8c200311240627 (diff)
Fix clippy::identity_conversion
Diffstat (limited to 'crates/ra_mbe/src/mbe_expander.rs')
-rw-r--r--crates/ra_mbe/src/mbe_expander.rs24
1 files changed, 12 insertions, 12 deletions
diff --git a/crates/ra_mbe/src/mbe_expander.rs b/crates/ra_mbe/src/mbe_expander.rs
index a0bd0c5f8..7cfb47f7a 100644
--- a/crates/ra_mbe/src/mbe_expander.rs
+++ b/crates/ra_mbe/src/mbe_expander.rs
@@ -206,48 +206,48 @@ fn match_lhs(pattern: &crate::Subtree, input: &mut TtCursor) -> Result<Bindings,
206 "path" => { 206 "path" => {
207 let path = 207 let path =
208 input.eat_path().ok_or(ExpandError::UnexpectedToken)?.clone(); 208 input.eat_path().ok_or(ExpandError::UnexpectedToken)?.clone();
209 res.inner.insert(text.clone(), Binding::Simple(path.into())); 209 res.inner.insert(text.clone(), Binding::Simple(path));
210 } 210 }
211 "expr" => { 211 "expr" => {
212 let expr = 212 let expr =
213 input.eat_expr().ok_or(ExpandError::UnexpectedToken)?.clone(); 213 input.eat_expr().ok_or(ExpandError::UnexpectedToken)?.clone();
214 res.inner.insert(text.clone(), Binding::Simple(expr.into())); 214 res.inner.insert(text.clone(), Binding::Simple(expr));
215 } 215 }
216 "ty" => { 216 "ty" => {
217 let ty = input.eat_ty().ok_or(ExpandError::UnexpectedToken)?.clone(); 217 let ty = input.eat_ty().ok_or(ExpandError::UnexpectedToken)?.clone();
218 res.inner.insert(text.clone(), Binding::Simple(ty.into())); 218 res.inner.insert(text.clone(), Binding::Simple(ty));
219 } 219 }
220 "pat" => { 220 "pat" => {
221 let pat = input.eat_pat().ok_or(ExpandError::UnexpectedToken)?.clone(); 221 let pat = input.eat_pat().ok_or(ExpandError::UnexpectedToken)?.clone();
222 res.inner.insert(text.clone(), Binding::Simple(pat.into())); 222 res.inner.insert(text.clone(), Binding::Simple(pat));
223 } 223 }
224 "stmt" => { 224 "stmt" => {
225 let pat = input.eat_stmt().ok_or(ExpandError::UnexpectedToken)?.clone(); 225 let pat = input.eat_stmt().ok_or(ExpandError::UnexpectedToken)?.clone();
226 res.inner.insert(text.clone(), Binding::Simple(pat.into())); 226 res.inner.insert(text.clone(), Binding::Simple(pat));
227 } 227 }
228 "block" => { 228 "block" => {
229 let block = 229 let block =
230 input.eat_block().ok_or(ExpandError::UnexpectedToken)?.clone(); 230 input.eat_block().ok_or(ExpandError::UnexpectedToken)?.clone();
231 res.inner.insert(text.clone(), Binding::Simple(block.into())); 231 res.inner.insert(text.clone(), Binding::Simple(block));
232 } 232 }
233 "meta" => { 233 "meta" => {
234 let meta = 234 let meta =
235 input.eat_meta().ok_or(ExpandError::UnexpectedToken)?.clone(); 235 input.eat_meta().ok_or(ExpandError::UnexpectedToken)?.clone();
236 res.inner.insert(text.clone(), Binding::Simple(meta.into())); 236 res.inner.insert(text.clone(), Binding::Simple(meta));
237 } 237 }
238 "tt" => { 238 "tt" => {
239 let token = input.eat().ok_or(ExpandError::UnexpectedToken)?.clone(); 239 let token = input.eat().ok_or(ExpandError::UnexpectedToken)?.clone();
240 res.inner.insert(text.clone(), Binding::Simple(token.into())); 240 res.inner.insert(text.clone(), Binding::Simple(token));
241 } 241 }
242 "item" => { 242 "item" => {
243 let item = 243 let item =
244 input.eat_item().ok_or(ExpandError::UnexpectedToken)?.clone(); 244 input.eat_item().ok_or(ExpandError::UnexpectedToken)?.clone();
245 res.inner.insert(text.clone(), Binding::Simple(item.into())); 245 res.inner.insert(text.clone(), Binding::Simple(item));
246 } 246 }
247 "lifetime" => { 247 "lifetime" => {
248 let lifetime = 248 let lifetime =
249 input.eat_lifetime().ok_or(ExpandError::UnexpectedToken)?.clone(); 249 input.eat_lifetime().ok_or(ExpandError::UnexpectedToken)?.clone();
250 res.inner.insert(text.clone(), Binding::Simple(lifetime.into())); 250 res.inner.insert(text.clone(), Binding::Simple(lifetime));
251 } 251 }
252 "literal" => { 252 "literal" => {
253 let literal = 253 let literal =
@@ -262,7 +262,7 @@ fn match_lhs(pattern: &crate::Subtree, input: &mut TtCursor) -> Result<Bindings,
262 // `vis` is optional 262 // `vis` is optional
263 if let Some(vis) = input.try_eat_vis() { 263 if let Some(vis) = input.try_eat_vis() {
264 let vis = vis.clone(); 264 let vis = vis.clone();
265 res.inner.insert(text.clone(), Binding::Simple(vis.into())); 265 res.inner.insert(text.clone(), Binding::Simple(vis));
266 } else { 266 } else {
267 res.push_optional(&text); 267 res.push_optional(&text);
268 } 268 }
@@ -452,7 +452,7 @@ fn expand_tt(
452 452
453 let idx = ctx.nesting.pop().unwrap(); 453 let idx = ctx.nesting.pop().unwrap();
454 ctx.nesting.push(idx + 1); 454 ctx.nesting.push(idx + 1);
455 token_trees.push(reduce_single_token(t).into()); 455 token_trees.push(reduce_single_token(t));
456 456
457 if let Some(ref sep) = repeat.separator { 457 if let Some(ref sep) = repeat.separator {
458 match sep { 458 match sep {