diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2016-01-30 17:57:16 +0530 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2016-01-30 17:57:16 +0530 |
| commit | 63cdec6a7fa2d92a300182e32561313c6ad5db5f (patch) | |
| tree | 488935d6923df59400bfea37b84083b674bc7e51 /src/libsyntax/parse/classify.rs | |
| parent | ee4f4edd477eb8c6235da2eb09424c26b157b97b (diff) | |
| parent | bbdef0ce59a74aa585186b4987e6f7751e49aea7 (diff) | |
| download | rust-63cdec6a7fa2d92a300182e32561313c6ad5db5f.tar.gz rust-63cdec6a7fa2d92a300182e32561313c6ad5db5f.zip | |
Rollup merge of #31244 - tshepang:rustfmt-parse, r=nikomatsakis
Diffstat (limited to 'src/libsyntax/parse/classify.rs')
| -rw-r--r-- | src/libsyntax/parse/classify.rs | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/libsyntax/parse/classify.rs b/src/libsyntax/parse/classify.rs index 8b3faaaca14..1193224bdb6 100644 --- a/src/libsyntax/parse/classify.rs +++ b/src/libsyntax/parse/classify.rs @@ -23,22 +23,22 @@ use ast; /// isn't parsed as (if true {...} else {...} | x) | 5 pub fn expr_requires_semi_to_be_stmt(e: &ast::Expr) -> bool { match e.node { - ast::ExprIf(..) - | ast::ExprIfLet(..) - | ast::ExprMatch(..) - | ast::ExprBlock(_) - | ast::ExprWhile(..) - | ast::ExprWhileLet(..) - | ast::ExprLoop(..) - | ast::ExprForLoop(..) => false, - _ => true + ast::ExprIf(..) | + ast::ExprIfLet(..) | + ast::ExprMatch(..) | + ast::ExprBlock(_) | + ast::ExprWhile(..) | + ast::ExprWhileLet(..) | + ast::ExprLoop(..) | + ast::ExprForLoop(..) => false, + _ => true, } } pub fn expr_is_simple_block(e: &ast::Expr) -> bool { match e.node { ast::ExprBlock(ref block) => block.rules == ast::DefaultBlock, - _ => false + _ => false, } } @@ -50,11 +50,11 @@ pub fn stmt_ends_with_semi(stmt: &ast::Stmt_) -> bool { ast::StmtDecl(ref d, _) => { match d.node { ast::DeclLocal(_) => true, - ast::DeclItem(_) => false + ast::DeclItem(_) => false, } } - ast::StmtExpr(ref e, _) => { expr_requires_semi_to_be_stmt(e) } - ast::StmtSemi(..) => { false } - ast::StmtMac(..) => { false } + ast::StmtExpr(ref e, _) => expr_requires_semi_to_be_stmt(e), + ast::StmtSemi(..) => false, + ast::StmtMac(..) => false, } } |
