From 9362ae1616e98b08a88dcb806a11a366ed1c6b8b Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Fri, 28 Aug 2020 16:45:25 -0700 Subject: [PATCH] Clarify guide for unbraced closures, regarding comments --- src/doc/style-guide/src/expressions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/doc/style-guide/src/expressions.md b/src/doc/style-guide/src/expressions.md index 1870b194d9d..0d4b97895cd 100644 --- a/src/doc/style-guide/src/expressions.md +++ b/src/doc/style-guide/src/expressions.md @@ -125,8 +125,8 @@ expression of the closure. Between the `|`s, use function definition syntax, but elide types where possible. Use closures without the enclosing `{}`, if possible. Add the `{}` when you have -a return type, when there are statements, when there are comments in the body, -or when the body expression spans multiple lines and is a control-flow +a return type, when there are statements, when there are comments inside the +closure, or when the body expression spans multiple lines and is a control-flow expression. If using braces, follow the rules above for blocks. Examples: ```rust