diff options
author | Denton Liu <liu.denton+github@gmail.com> | 2016-08-25 03:28:07 +0800 |
---|---|---|
committer | Denton Liu <liu.denton+github@gmail.com> | 2016-08-27 01:33:42 +0800 |
commit | 532266b89e07d37115d160d3d1148b50e4fb1dfc (patch) | |
tree | 1f0be9568ebd277e07275b4baf0b1c214cb644a9 /docs | |
parent | f1e6bc2eaa452412e8050f72ff14ad738dbe49bc (diff) | |
download | dexon-solidity-532266b89e07d37115d160d3d1148b50e4fb1dfc.tar dexon-solidity-532266b89e07d37115d160d3d1148b50e4fb1dfc.tar.gz dexon-solidity-532266b89e07d37115d160d3d1148b50e4fb1dfc.tar.bz2 dexon-solidity-532266b89e07d37115d160d3d1148b50e4fb1dfc.tar.lz dexon-solidity-532266b89e07d37115d160d3d1148b50e4fb1dfc.tar.xz dexon-solidity-532266b89e07d37115d160d3d1148b50e4fb1dfc.tar.zst dexon-solidity-532266b89e07d37115d160d3d1148b50e4fb1dfc.zip |
Use new style for the docs
Diffstat (limited to 'docs')
-rw-r--r-- | docs/common-patterns.rst | 9 | ||||
-rw-r--r-- | docs/control-structures.rst | 3 | ||||
-rw-r--r-- | docs/frequently-asked-questions.rst | 9 | ||||
-rw-r--r-- | docs/solidity-by-example.rst | 3 |
4 files changed, 10 insertions, 14 deletions
diff --git a/docs/common-patterns.rst b/docs/common-patterns.rst index 74f9c078..531a94ad 100644 --- a/docs/common-patterns.rst +++ b/docs/common-patterns.rst @@ -45,8 +45,7 @@ become the new richest. richest = msg.sender; mostSent = msg.value; return true; - } - else { + } else { return false; } } @@ -58,8 +57,7 @@ become the new richest. pendingWithdrawals[msg.sender] = 0; if (msg.sender.send(amount)) { return true; - } - else { + } else { pendingWithdrawals[msg.sender] = amount; return false; } @@ -90,8 +88,7 @@ This is as opposed to the more intuitive sending pattern. richest = msg.sender; mostSent = msg.value; return true; - } - else { + } else { return false; } } diff --git a/docs/control-structures.rst b/docs/control-structures.rst index b3940f72..0e430b6b 100644 --- a/docs/control-structures.rst +++ b/docs/control-structures.rst @@ -275,8 +275,7 @@ As a result, the following code is legal, despite being poorly written:: uint bar = 5; if (true) { bar += baz; - } - else { + } else { uint baz = 10;// never executes } return bar;// returns 5 diff --git a/docs/frequently-asked-questions.rst b/docs/frequently-asked-questions.rst index c28b4ab7..7e69093f 100644 --- a/docs/frequently-asked-questions.rst +++ b/docs/frequently-asked-questions.rst @@ -461,16 +461,17 @@ If you do not want to throw, you can return a pair:: function getCounter(uint index) returns (uint counter, bool error) { - if (index >= counters.length) return (0, true); - else return (counters[index], false); + if (index >= counters.length) + return (0, true); + else + return (counters[index], false); } function checkCounter(uint index) { var (counter, error) = getCounter(index); if (error) { ... - } - else { + } else { ... } } diff --git a/docs/solidity-by-example.rst b/docs/solidity-by-example.rst index 61589b2e..8e23dafd 100644 --- a/docs/solidity-by-example.rst +++ b/docs/solidity-by-example.rst @@ -133,8 +133,7 @@ of votes. // If the delegate already voted, // directly add to the number of votes proposals[delegate.vote].voteCount += sender.weight; - } - else { + } else { // If the delegate did not vote yet, // add to her weight. delegate.weight += sender.weight; |