aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-12-03 18:19:17 +0800
committerGitHub <noreply@github.com>2018-12-03 18:19:17 +0800
commit413cb67a55d62335f2d8caa3e563544ab6cf691d (patch)
tree2320041029af5a9cc0083f399006c12ce6d1ea5f
parent3159e2a22033e6449c3b881a7cecd0cd5ec47dba (diff)
parentbbe0268163b95c147df1cc894ea8f9e8211a7930 (diff)
downloaddexon-solidity-413cb67a55d62335f2d8caa3e563544ab6cf691d.tar.gz
dexon-solidity-413cb67a55d62335f2d8caa3e563544ab6cf691d.tar.zst
dexon-solidity-413cb67a55d62335f2d8caa3e563544ab6cf691d.zip
Merge pull request #5532 from ethereum/docs-style-add-mapping
DOCS: Add mapping guide to style docs
-rw-r--r--docs/style-guide.rst18
1 files changed, 17 insertions, 1 deletions
diff --git a/docs/style-guide.rst b/docs/style-guide.rst
index 7b48ccad..68fee871 100644
--- a/docs/style-guide.rst
+++ b/docs/style-guide.rst
@@ -809,7 +809,23 @@ possible permutations for function declarations.
Mappings
========
-TODO
+In variable declarations, do not separate the keyword ``mapping`` from its
+type by a space. Do not separate any nested ``mapping`` keyword from its type by
+whitespace.
+
+Yes::
+
+ mapping(uint => uint) map;
+ mapping(address => bool) registeredAddresses;
+ mapping(uint => mapping(bool => Data[])) public data;
+ mapping(uint => mapping(uint => s)) data;
+
+No::
+
+ mapping (uint => uint) map;
+ mapping( address => bool ) registeredAddresses;
+ mapping (uint => mapping (bool => Data[])) public data;
+ mapping(uint => mapping (uint => s)) data;
Variable Declarations
=====================