Use a binary comprehension
Instead of converting to a charlist and back.
This commit is contained in:
parent
cc9e0386f0
commit
dbc2a91b15
1 changed files with 1 additions and 3 deletions
|
@ -182,9 +182,7 @@ defmodule LineBotSample do
|
||||||
code
|
code
|
||||||
|> String.trim()
|
|> String.trim()
|
||||||
|> String.upcase()
|
|> String.upcase()
|
||||||
|> String.to_charlist()
|
|> (&for(<<cp::utf8 <- &1>>, into: "", do: <<cp + 0x1F1A5::utf8>>)).()
|
||||||
|> Enum.map(&(&1 + 0x1F1A5))
|
|
||||||
|> List.to_string()
|
|
||||||
|
|
||||||
log_and_reply(request_message, %Message.Text{text: code}, reply_token)
|
log_and_reply(request_message, %Message.Text{text: code}, reply_token)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue