mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #5532 from ethereum/docs-style-add-mapping
DOCS: Add mapping guide to style docs
This commit is contained in:
commit
413cb67a55
@ -809,7 +809,23 @@ possible permutations for function declarations.
|
|||||||
Mappings
|
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
|
Variable Declarations
|
||||||
=====================
|
=====================
|
||||||
|
Loading…
Reference in New Issue
Block a user