diff options
| author | Tshepang Lekhonkhobe <tshepang@gmail.com> | 2016-01-27 21:42:26 +0200 |
|---|---|---|
| committer | Tshepang Lekhonkhobe <tshepang@gmail.com> | 2016-01-27 21:45:14 +0200 |
| commit | bbdef0ce59a74aa585186b4987e6f7751e49aea7 (patch) | |
| tree | 83096362580b53c5f29f056ca93e549e5578c18c /src/libsyntax/parse/classify.rs | |
| parent | b8b18aac12214d7135a083e2e6946aa197185d49 (diff) | |
| download | rust-bbdef0ce59a74aa585186b4987e6f7751e49aea7.tar.gz rust-bbdef0ce59a74aa585186b4987e6f7751e49aea7.zip | |
rustfmt syntax::parse
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, } } |
