Skip to content

Commit 005c916

Browse files
Move keyword list syntax rule into collections
1 parent fedefb2 commit 005c916

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

README.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -387,20 +387,6 @@ are provided here as examples of the preferred style.
387387
2 |> rem(3) |> g
388388
```
389389

390-
### Syntax
391-
392-
* <a name="keyword-list-syntax"></a>
393-
Always use the special syntax for keyword lists.
394-
<sup>[[link](#keyword-list-syntax)]</sup>
395-
396-
```elixir
397-
# not preferred
398-
some_value = [{:a, "baz"}, {:b, "qux"}]
399-
400-
# preferred
401-
some_value = [a: "baz", b: "qux"]
402-
```
403-
404390
* <a name="keyword-list-brackets"></a>
405391
Omit square brackets from keyword lists whenever they are optional.
406392
<sup>[[link](#keyword-list-brackets)]</sup>
@@ -1187,7 +1173,17 @@ directives (see [Modules](#modules)).
11871173

11881174
### Collections
11891175

1190-
_No guidelines for collections have been added yet._
1176+
* <a name="keyword-list-syntax"></a>
1177+
Always use the special syntax for keyword lists.
1178+
<sup>[[link](#keyword-list-syntax)]</sup>
1179+
1180+
```elixir
1181+
# not preferred
1182+
some_value = [{:a, "baz"}, {:b, "qux"}]
1183+
1184+
# preferred
1185+
some_value = [a: "baz", b: "qux"]
1186+
```
11911187

11921188
### Strings
11931189

0 commit comments

Comments
 (0)