diff options
author | robojumper <[email protected]> | 2020-05-31 11:06:22 +0100 |
---|---|---|
committer | robojumper <[email protected]> | 2020-05-31 11:06:22 +0100 |
commit | cc6ba84c400417af873462364ba5cd4f6b5ab1f6 (patch) | |
tree | 7efa8f836b8bdf8dbedc646b34af4b7216505873 /crates/ra_hir_def/src/body | |
parent | 1cd78a3355ea70d3070cabb00c80a5d195499752 (diff) |
fmt
Diffstat (limited to 'crates/ra_hir_def/src/body')
-rw-r--r-- | crates/ra_hir_def/src/body/lower.rs | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index dc52c6bd9..f159f80af 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs | |||
@@ -218,7 +218,10 @@ impl ExprCollector<'_> { | |||
218 | self.alloc_expr( | 218 | self.alloc_expr( |
219 | Expr::Loop { | 219 | Expr::Loop { |
220 | body, | 220 | body, |
221 | label: e.label().and_then(|l| l.lifetime_token()).map(|l| Name::new_lifetime(&l)), | 221 | label: e |
222 | .label() | ||
223 | .and_then(|l| l.lifetime_token()) | ||
224 | .map(|l| Name::new_lifetime(&l)), | ||
222 | }, | 225 | }, |
223 | syntax_ptr, | 226 | syntax_ptr, |
224 | ) | 227 | ) |
@@ -247,7 +250,10 @@ impl ExprCollector<'_> { | |||
247 | return self.alloc_expr( | 250 | return self.alloc_expr( |
248 | Expr::Loop { | 251 | Expr::Loop { |
249 | body: match_expr, | 252 | body: match_expr, |
250 | label: e.label().and_then(|l| l.lifetime_token()).map(|l| Name::new_lifetime(&l)), | 253 | label: e |
254 | .label() | ||
255 | .and_then(|l| l.lifetime_token()) | ||
256 | .map(|l| Name::new_lifetime(&l)), | ||
251 | }, | 257 | }, |
252 | syntax_ptr, | 258 | syntax_ptr, |
253 | ); | 259 | ); |
@@ -259,7 +265,10 @@ impl ExprCollector<'_> { | |||
259 | Expr::While { | 265 | Expr::While { |
260 | condition, | 266 | condition, |
261 | body, | 267 | body, |
262 | label: e.label().and_then(|l| l.lifetime_token()).map(|l| Name::new_lifetime(&l)), | 268 | label: e |
269 | .label() | ||
270 | .and_then(|l| l.lifetime_token()) | ||
271 | .map(|l| Name::new_lifetime(&l)), | ||
263 | }, | 272 | }, |
264 | syntax_ptr, | 273 | syntax_ptr, |
265 | ) | 274 | ) |
@@ -273,7 +282,10 @@ impl ExprCollector<'_> { | |||
273 | iterable, | 282 | iterable, |
274 | pat, | 283 | pat, |
275 | body, | 284 | body, |
276 | label: e.label().and_then(|l| l.lifetime_token()).map(|l| Name::new_lifetime(&l)), | 285 | label: e |
286 | .label() | ||
287 | .and_then(|l| l.lifetime_token()) | ||
288 | .map(|l| Name::new_lifetime(&l)), | ||
277 | }, | 289 | }, |
278 | syntax_ptr, | 290 | syntax_ptr, |
279 | ) | 291 | ) |
@@ -329,12 +341,10 @@ impl ExprCollector<'_> { | |||
329 | .unwrap_or(Expr::Missing); | 341 | .unwrap_or(Expr::Missing); |
330 | self.alloc_expr(path, syntax_ptr) | 342 | self.alloc_expr(path, syntax_ptr) |
331 | } | 343 | } |
332 | ast::Expr::ContinueExpr(e) => { | 344 | ast::Expr::ContinueExpr(e) => self.alloc_expr( |
333 | self.alloc_expr( | 345 | Expr::Continue { label: e.lifetime_token().map(|l| Name::new_lifetime(&l)) }, |
334 | Expr::Continue { label: e.lifetime_token().map(|l| Name::new_lifetime(&l)) }, | 346 | syntax_ptr, |
335 | syntax_ptr, | 347 | ), |
336 | ) | ||
337 | } | ||
338 | ast::Expr::BreakExpr(e) => { | 348 | ast::Expr::BreakExpr(e) => { |
339 | let expr = e.expr().map(|e| self.collect_expr(e)); | 349 | let expr = e.expr().map(|e| self.collect_expr(e)); |
340 | self.alloc_expr( | 350 | self.alloc_expr( |