From 3be085379d507a9168b3254c7987b807899b9c50 Mon Sep 17 00:00:00 2001 From: pmeredit Date: Wed, 22 Nov 2017 09:59:39 -0500 Subject: [PATCH] Update expressions.md I think we should enforce the '=>' in match expressions be in a straight column. This makes code much easier to read, and since we will be using an automatic formatting tool, it's not hard to keep up-to-date (the usual argument against such a style). I also think the types in a struct definition should be in a straight column. --- guide/expressions.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/guide/expressions.md b/guide/expressions.md index 78c86fe..864e95f 100644 --- a/guide/expressions.md +++ b/guide/expressions.md @@ -312,6 +312,18 @@ match foo { } ``` +The `=>` in the match should be in a straight column. + +Examples: + +```rust +match foo { + foo => bar, + foofoo => barbar, + foofoofoo => barbarbar, +} +``` + If the body is a single expression with no line comments is a *combinable expression* (see below for details), then it may be started on the same line as the right-hand side. If not, then it must be in a block. Example,