diff options
author | Chris Ward <chriswhward@gmail.com> | 2018-11-12 19:06:59 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-12-03 17:43:53 +0800 |
commit | bbe0268163b95c147df1cc894ea8f9e8211a7930 (patch) | |
tree | b376a6b02041f4cb2f8f93c876839ebf2f38b04b /docs/style-guide.rst | |
parent | 25c63dde28f4f3d2565646c4f8831d71e0f2fd7b (diff) | |
download | dexon-solidity-bbe0268163b95c147df1cc894ea8f9e8211a7930.tar.gz dexon-solidity-bbe0268163b95c147df1cc894ea8f9e8211a7930.tar.zst dexon-solidity-bbe0268163b95c147df1cc894ea8f9e8211a7930.zip |
Add mapping guide to style docs thanks to @aupiff
Diffstat (limited to 'docs/style-guide.rst')
-rw-r--r-- | docs/style-guide.rst | 18 |
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 ===================== |