aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_fmt
diff options
context:
space:
mode:
authorSeivan Heidari <[email protected]>2019-11-21 00:11:41 +0000
committerSeivan Heidari <[email protected]>2019-11-21 00:11:41 +0000
commit358a1bcd708c622836723e5201b6de77cc9ff327 (patch)
treeaeff9c96a6059fa2b02e7c87ec88753bc7993d8d /crates/ra_fmt
parent1e2d090ab8a9bda18f148b894b7948eb05b976e6 (diff)
parent612a72fc4ea4376920f2a7da7b3c334227c1716c (diff)
Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into feature/themes
Diffstat (limited to 'crates/ra_fmt')
-rw-r--r--crates/ra_fmt/src/lib.rs3
1 files changed, 0 insertions, 3 deletions
diff --git a/crates/ra_fmt/src/lib.rs b/crates/ra_fmt/src/lib.rs
index a30ed4cbb..10f592257 100644
--- a/crates/ra_fmt/src/lib.rs
+++ b/crates/ra_fmt/src/lib.rs
@@ -38,9 +38,6 @@ fn prev_tokens(token: SyntaxToken) -> impl Iterator<Item = SyntaxToken> {
38pub fn extract_trivial_expression(expr: &ast::BlockExpr) -> Option<ast::Expr> { 38pub fn extract_trivial_expression(expr: &ast::BlockExpr) -> Option<ast::Expr> {
39 let block = expr.block()?; 39 let block = expr.block()?;
40 let expr = block.expr()?; 40 let expr = block.expr()?;
41 if expr.syntax().text().contains_char('\n') {
42 return None;
43 }
44 let non_trivial_children = block.syntax().children().filter(|it| match it.kind() { 41 let non_trivial_children = block.syntax().children().filter(|it| match it.kind() {
45 WHITESPACE | T!['{'] | T!['}'] => false, 42 WHITESPACE | T!['{'] | T!['}'] => false,
46 _ => it != expr.syntax(), 43 _ => it != expr.syntax(),