Add mapping guide to style docs thanks to @aupiff

This commit is contained in:
Chris Ward 2018-11-12 12:06:59 +01:00 committed by chriseth
parent 25c63dde28
commit bbe0268163

View File

@ -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
=====================