about summary refs log tree commit diff
path: root/src/expr.rs
diff options
context:
space:
mode:
authorZach Lute <zach.lute@gmail.com>2018-08-25 21:02:24 -0700
committerSeiichi Uchida <seuchida@gmail.com>2018-08-26 13:02:24 +0900
commitca19c9a35a22d04d9911c95e6e8619082cc45f1b (patch)
tree081ded3e0fac8227c4c9e62044e6e6bff37b0cc7 /src/expr.rs
parent10512a59d00cd5b1f134d78a7ff4e2ce5abb9b12 (diff)
Fix build with rust nightly by updating try block syntax. (#2965)
Diffstat (limited to 'src/expr.rs')
-rw-r--r--src/expr.rs17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/expr.rs b/src/expr.rs
index e6161c0c42b..fdea683df0a 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -317,22 +317,17 @@ pub fn format_expr(
         // We do not format these expressions yet, but they should still
         // satisfy our width restrictions.
         ast::ExprKind::InlineAsm(..) => Some(context.snippet(expr.span).to_owned()),
-        ast::ExprKind::Catch(ref block) => {
-            if let rw @ Some(_) = rewrite_single_line_block(
-                context,
-                "do catch ",
-                block,
-                Some(&expr.attrs),
-                None,
-                shape,
-            ) {
+        ast::ExprKind::TryBlock(ref block) => {
+            if let rw @ Some(_) =
+                rewrite_single_line_block(context, "try ", block, Some(&expr.attrs), None, shape)
+            {
                 rw
             } else {
-                // 9 = `do catch `
+                // 9 = `try `
                 let budget = shape.width.saturating_sub(9);
                 Some(format!(
                     "{}{}",
-                    "do catch ",
+                    "try ",
                     rewrite_block(
                         block,
                         Some(&expr.attrs),