From bbe0268163b95c147df1cc894ea8f9e8211a7930 Mon Sep 17 00:00:00 2001 From: Chris Ward Date: Mon, 12 Nov 2018 12:06:59 +0100 Subject: Add mapping guide to style docs thanks to @aupiff --- docs/style-guide.rst | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'docs') 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 ===================== -- cgit