-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor transform_role_list_to_string/1 to use Enum.map_join suggest…
…ed by @SimonLab in #4 (comment)
- Loading branch information
Showing
2 changed files
with
2 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,6 @@ defmodule RBAC do | |
""" | ||
def transform_role_list_to_string(role_list) do | ||
for i <- role_list do | ||
i.id |> Integer.to_string | ||
end | ||
|> Enum.join(",") | ||
Enum.map_join(role_list, ",", &(&1.id)) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
nelsonic
Author
Member
|
||
end | ||
end |
Is there a reason of using a map list instead of a keyword list?