Use more succinct syntax for mapping with String.capitalize.

This commit is contained in:
Michal Kwiatkowski
2017-10-27 09:01:36 +02:00
parent 086136af9c
commit 586e5ca0b1

View File

@@ -92,7 +92,7 @@ defmodule Functions do
koan "The result of a function can be piped into another function as its first argument" do
result = "full-name"
|> String.split("-")
|> Enum.map(&(String.capitalize(&1)))
|> Enum.map(&String.capitalize/1)
|> Enum.join(" ")
assert result == ___