Skip to content

Commit

Permalink
Resolve build warnings of deprecated String.strip/1 method
Browse files Browse the repository at this point in the history
  • Loading branch information
theodowling committed Aug 19, 2017
1 parent 5feaec3 commit 98bc5d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/mustache.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ defmodule Mustache do
first_scan = List.first(scans)
variable = first_scan |> clean(["{{", "}}"])
value = if escape?(first_scan) do
key = variable |> String.strip
key = variable |> String.trim
data |> indifferent_access(key) |> to_string |> escape
else
key = String.replace(variable, "&", "") |> String.strip
key = String.replace(variable, "&", "") |> String.trim
data |> indifferent_access(key) |> to_string
end
if value == nil do
Expand Down Expand Up @@ -55,7 +55,7 @@ defmodule Mustache do
[] -> template
_ ->
variable = List.first(scans) |> clean(["{{{", "}}}"])
key = variable |> String.strip
key = variable |> String.trim
value = data |> indifferent_access(key) |> to_string
if value == nil do
template
Expand Down

0 comments on commit 98bc5d4

Please sign in to comment.