aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/style-guide.rst13
1 files changed, 7 insertions, 6 deletions
diff --git a/docs/style-guide.rst b/docs/style-guide.rst
index c7b13efa..f4b419c0 100644
--- a/docs/style-guide.rst
+++ b/docs/style-guide.rst
@@ -273,17 +273,17 @@ No::
}));
For ``if`` blocks which have an ``else`` or ``else if`` clause, the ``else`` should be
-placed on it's own line following the previous closing parenthesis. The
-parenthesis for the else block should follow the same rules as the other
-conditional control structures.
+placed on the same line as the ``if``'s closing brace. This is an exception compared
+to the rules of other block-like structures.
Yes::
if (x < 3) {
x += 1;
- }
- else {
+ } else if (x > 7) {
x -= 1;
+ } else {
+ x = 5;
}
@@ -296,7 +296,8 @@ No::
if (x < 3) {
x += 1;
- } else {
+ }
+ else {
x -= 1;
}